3

I want renovate not to auto merge "major" updates of certain dependencies, but it should auto merge other updates from those dependencies.

For example, if I want renovate to auto merge all "minor" and "patch" updates of eslint, but it should not auto merge all the "major" updates to eslint.

How can I define the rules in my renovate json file to comply for this requirement.

2 Answers2

2

This package rule from the docs will automerge all minor and patch updates with a version number greater than 1.0.0.

{
  "packageRules": [
    {
      "matchUpdateTypes": ["minor", "patch"],
      "matchCurrentVersion": "!/^0/",
      "automerge": true
    }
  ]
}
danielnelz
  • 3,794
  • 4
  • 25
  • 35
1

The example in the docs using the regex !/^0/ doesn't work for all languages. Go versions for example tend to be prefixed with v. A better solution is to have a rule that uses the parsed semver. The rule below works for all languages.

{
  "packageRules": [
    {
      "matchUpdateTypes": ["patch"],
      "matchCurrentVersion": ">= 1.0.0",
      "automerge": true
    }
}
Adam B
  • 1,140
  • 2
  • 18
  • 30