Article
dependency-managementautomationdevsecopssecurityci-cdgithubpackage-management
Automate Dependency Updates with the Renovate Agent
Use the Renovate Dependency Updater Agent to automatically keep project dependencies current. Add a configuration file to your repository to let the agent scan for outdated packages and open pull requests with tested upgrades, reducing security risks and manual toil.
beginner15 min4 steps
The play
- Install the Renovate AppNavigate to the Renovate GitHub App page (via the official mend.io/renovate URL) and install it on your account. Grant it access to the specific repository you want to automate. Once installed, Renovate will look for a configuration file to begin its process.
- Create a Basic Configuration FileIn the root of your repository, create a `renovate.json` file. This file tells the Renovate agent how to behave. The simplest configuration extends the default preset, which enables Renovate with sensible defaults for most projects.
- Group Updates to Reduce NoiseA common issue is receiving too many individual PRs. Use `packageRules` to group related dependencies into a single PR. This example groups all non-major updates for `devDependencies` into one pull request, keeping your PR list clean.
- Schedule Renovate RunsTo avoid disruptions during work hours, you can schedule when the Renovate agent creates PRs. This configuration limits PR creation to after 10 PM on weekdays and any time on weekends, minimizing CI/CD noise during peak hours.
Starter code
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"prHeader": "[MAINTENANCE]",
"labels": ["dependencies", "renovate"],
"schedule": [
"after 10pm on weekdays",
"before 5am on weekdays",
"every weekend"
],
"packageRules": [
{
"description": "Group all non-major dev dependency updates",
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"matchDepTypes": ["devDependencies"],
"groupName": "all dev dependencies (non-major)"
},
{
"description": "Automatically merge patch updates for non-breaking changes if tests pass",
"matchUpdateTypes": ["patch"],
"automerge": true
}
]
}