When using Renovate it can sometimes be required to run a specific manager only on a sub-set of the matching files.
Naively you might expect this to be achieved by overwriting the fileMatch
property of the manager.
However this is not possible, as this property gets merged together,
effectively meaning we can only append to it, not replace it.
What I found working is an approach using either includePaths
or ignorePaths
, depending on the situation.
Example: includePaths
Imagine a repository that looks like this.
We want to only update the Chart dependencies inside development/
folders.
$ tree -A
.
├── app-1
│ ├── development
│ │ └── Chart.yaml
│ ├── production
│ │ └── Chart.yaml
│ └── qa
│ └── Chart.yaml
├── app-2
│ ├── development
│ │ └── Chart.yaml
│ ├── production
│ │ └── Chart.yaml
│ └── qa
│ └── Chart.yaml
└── app-3
├── development
│ └── Chart.yaml
├── production
│ └── Chart.yaml
└── qa
└── Chart.yaml
We can achieve it using the includePaths
property1.
Include package files only within these defined paths.
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"helmv3": {
"includePaths": ["**/development/Chart.yaml"]
}
}
Example: ignorePaths
Imagine a repository that looks like this. Now we want to not update the Chart dependencies if they are in vendored code.
$ tree -A
.
├── app-1
│ ├── development
│ │ └── Chart.yaml
│ ├── production
│ │ └── Chart.yaml
│ ├── qa
│ │ └── Chart.yaml
│ └── vendored
│ └── Chart.yaml
├── app-2
│ ├── development
│ │ ├── Chart.yaml
│ │ └── vendored
│ │ └── Chart.yaml
│ ├── production
│ │ └── Chart.yaml
│ └── qa
│ └── Chart.yaml
├── app-3
│ ├── development
│ │ └── Chart.yaml
│ ├── production
│ │ └── Chart.yaml
│ └── qa
│ └── Chart.yaml
└── vendored
└── Chart.yaml
We can achieve it using the ignorePaths
property2.
Skip any package file whose path matches one of these. Can be a string or glob pattern.
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"helmv3": {
"ignorePaths": ["**/vendored/**", "**vendored/**"]
}
}