DependAware - Automatic Dependency Update π
DependAware is an automated dependency update tool for NPM repositories that creates pull requests for updating package dependencies in your repositories. It helps you keep your projects up-to-date and secure by automatically updating outdated or vulnerable dependencies.
Features
- Automatically scans and detects outdated or vulnerable package dependencies in NPM repositories
- Creates pull requests for each updated dependency with detailed titles and descriptions
- Easy integration with GitHub Actions
- Adds the "dependencies" label to the pull requests
- Runs tests for each pull request and updates the PR description with the test results
- Supports manually triggering the workflows or configuring them to run automatically
- Handles existing pull requests gracefully without causing job failures
Prerequisites
- A GitHub repository with an NPM project
- A GitHub Personal Access Token (PAT) with the necessary permissions
- The "dependencies" label created in your repository
Setup
Follow these steps to set up DependAware in your repository:
-
Fork or clone this repository to your local machine.
-
Copy the
check_dependencies.ymlfile from this repository to the.github/workflowsfolder in your project repository. This file contains the GitHub Actions workflow for checking outdated dependencies in your NPM project. -
Copy the
create_prs.ymlfile from this repository to the.github/workflowsfolder in your project repository. This file contains the GitHub Actions workflow for creating pull requests from branches created by the main action. -
Copy the
createDependencyBranches.shfile from this repository to your project repository. This shell script is used to create branches for each outdated dependency. -
Set up your Git configuration with your email and name:
git config --global user.email "your_email@example.com" git config --global user.name "Your Name" -
In your project repository, navigate to "Settings" > "Secrets" > "New repository secret" and create a secret named
GH_PAT. Set its value to your GitHub Personal Access Token. -
Commit and push your changes to your project repository.
-
Navigate to the "Actions" tab in your repository and manually trigger the "Check Dependencies" and "Create Pull Requests" workflows.
DependAware will now scan your NPM project, create branches for each outdated dependency, and create pull requests for each branch with detailed titles and descriptions, and labeled with "dependencies". It will also run tests for each pull request and update the PR description with the test results.
Potential New Features π‘
- Automatic merging of pull requests when tests pass
- Customizable test commands and branch naming conventions
- Support for other package managers such as Yarn, Pip, and Composer
- Integration with other CI/CD platforms like GitLab CI/CD or Bitbucket Pipelines
- Automatic notification of dependency updates via email or other communication channels
Feel free to contribute to this project and help implement these new features or suggest additional ones!