Configure renovate bot to merge minor and patch updates automatically
Answer a question
On my GitHub repo I want to configure the renovate bot to automatically merge all minor (and smaller) updates automatically and to create PRs only for major updates. If I understand the doc correctly, my package rules should configure that behaviour:
{
"extends": [
"config:base",
":disableDependencyDashboard"
],
"ignorePaths": [
"Dockerfile",
"package.json",
"pnpm-lock.yaml"
],
"assignees": [
"McPringle"
],
"reviewers": [
"McPringle"
],
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
},
{
"matchDepTypes": ["devDependencies"],
"automerge": true
}
]
}
But the renovate bot does not merge the minor updates. Still, everything comes as a PR, which I have to merge manually. This is an example:
- <version>2.6.1</version>
+ <version>2.6.2</version>
This patch update should be merged automatically. Can someone please explain what I am understanding and doing wrong? Here you can find the GitHub repo I'm talking about including the renovate config file and the PR, which I have not merged now: https://github.com/komunumo/komunumo-server
Answers
Here I am documenting my solution which I found with the help from the Renovate discussion forum at GitHub:
- In
renovate.json, configurepackageRuleswithautomergeand activateplatformAutomerge:
{
"extends": [
"config:base"
],
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
},
{
"matchDepTypes": ["devDependencies"],
"automerge": true
}
],
"platformAutomerge": true
}
-
In the GitHub repository settings, go to
Optionand activate at leastAllow auto-mergeandAutomatically delete head branches:
-
In the GitHub repository settings, go to
Branchesand add a branch protection rule for yourmainormasterbranch (whatever you are using). ActivateRequire status checks to pass before mergingandRequire branches to be up to date before merging. If GitHub tells you "No status checks found", just ignore that. Rules must be saved explicitly (scroll down to the "Save" button).
The next PR from the renovate bot should be merged automatically.
更多推荐


所有评论(0)