A Node.js script that allows you to remotely upgrade specified dependencies in a GitHub project to a specified version. This tool is useful for maintaining project dependencies across multiple repositories and can be integrated into Continuous Integration (CI) environments for automated dependency management.
- Upgrade a specified dependency to a desired version in a GitHub repository.
- Authenticate using a fine-grained GitHub token.
- Node.js installed on your machine
- A fine-grained GitHub token with the necessary permissions to read and write to the repository
- Clone the repository and navigate to the project directory:
- Install the necessary dependencies:
npm install
To upgrade a dependency, run the script with the following options:
node gh-pkg-upgrade.js --pkg-name <package-name> --pkg-version <version> --owner <owner> --repo <repository> --token <github-token>
- -n, --pkg-name : Name of the package to upgrade (required)
- -v, --pkg-version : Version to upgrade the package to (required)
- -o, --owner : Owner of the GitHub repository (required)
- -r, --repo : Name of the GitHub repository (required)
- -t, --token : Fine-grained GitHub token (required)
Example
node gh-pkg-upgrade.js --pkg-name lodash --pkg-version 4.17.21 --owner my-github-username --repo my-repository --token ghp_abcdefghijklmnopqrstuvwxyz123456
This project is done as a leisure project and it's not recommended for production use in its current form. While it demonstrates useful concepts and provides basic functionality, it may lack the robustness and security required for production environments.