Exclude a dependency from Renovate updates
Asked Answered
I

2

7

I use Renovate to keep my dependencies up-to-date. However there are some dependencies that I want to exclude from automatic updates, i.e. I don't want Renovate to update them, ever.

One such dependency is Postgres, which is specified in docker-compose.yml like so:

services:
  db:
    image: postgres:11

Currently, Renovate is creating PRs that would change the 11 to 15. Is there a configuration option in Renovate that allows me to exclude this dependency from Renovate?

Iand answered 15/11, 2022 at 14:43 Comment(0)
B
8

You want to use a package-rules.

This rule will disable updates for all dependencies found in docker compose files which have postgres in their name.

{
  "packageRules": [
    {
      "matchPackageNames": ["/postgres/"],
      "matchManagers": ["docker-compose"],
      "enabled": false
    }
  ]
}
Bod answered 8/3, 2023 at 7:9 Comment(0)
P
3

I use ignoreDeps in renovate.json e.g.

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:base"],
  "schedule": ["before 7am on the first day of the month"],
  "ignoreDeps": ["postgres"],
  "rangeStrategy": "update-lockfile",
  "packageRules": [
    {
      "description": "Group minor and patch dependency updates",
      "matchPackagePatterns": ["*"],
      "matchUpdateTypes": ["minor", "patch"],
      "groupName": "all non-major dependencies",
      "groupSlug": "all-minor-patch"
    }
  ]
}
Phonetics answered 26/3, 2024 at 9:55 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.