A script that removes the ban-sensitive-files
module from the devDependencies
of microservices hosted on GitHub Enterprise Server. The script performs the following actions for each repository:
- Clone the repository to a local directory
- Create a new branch named
feature/remove-ban-sensitive-files
from the given branch name - Remove the
ban-sensitive-files
module from thedevDependencies
of thepackage.json
file - Rebuild the
package-lock.json
file - Commit the changes to the new branch and push them to the remote repository
- Create a pull request with the title "Remove ban-sensitive-files module from dev dependencies" and a message detailing the changes made.
- Node.js 14 or higher
- A valid GitHub Enterprise Server account with appropriate permissions to the repositories
- Clone this repository to your local machine.
- Navigate to the project directory and run
npm install
to install the necessary dependencies.
- Modify the
repositories
andbranches
arrays in theindex.js
file to include the names of the repositories and branches you want to modify. - Update the
githubCredentials
object in theindex.js
file to include your GitHub Enterprise Server credentials. - Run the script by executing the command
npm start
in the project directory. - The script will clone each repository, create a new branch, remove the
ban-sensitive-files
module, and create a pull request.
The script comes with a set of test cases that can be run using the npm test
command. The tests verify the functionality of the script under different scenarios, such as invalid repository or branch names, missing ban-sensitive-files
module in package.json
, and invalid GitHub credentials.
Contributions are welcome! If you have an idea or suggestion for improving the script, please open an issue or submit a pull request.