diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 12e9cf481e1cde5e5280e09796b6adeba68a57bd..8f9d38a9791d3f1bcb2ba2ee95d6b4904fee3ba8 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -869,6 +869,19 @@ Path rules are convenient to use if you wish to apply configuration rules to cer } ``` +If you wish to limit renovate to apply configuration rules to certain files in the root repository directory, you have to use `paths` with either a partial string match or a minimatch pattern. For example you have multiple `package.json` and want to use `masterIssueApproval` only on the root `package.json`: + +```json +{ + "packageRules": [ + { + "paths": ["+(package.json)"], + "masterIssueApproval": true + } + ] +} +``` + Important to know: Renovate will evaluate all `packageRules` and not stop once it gets a first match. Therefore, you should order your `packageRules` in order of importance so that later rules can override settings from earlier rules if necessary. ### allowedVersions @@ -1029,6 +1042,18 @@ The above will configure `rangeStrategy` to `replace` for any package starting w ### paths +Renovate will match `paths` against both a partial string match or a minimatch glob pattern. If you want to avoid the partial string matching so that only glob matching is performed, wrap your string in `+(...)` like so: + +``` + "paths": ["+(package.json)"], +``` + +The above will match only the root `package.json`, whereas the following would match any `package.json` in any subdirectory too: + +``` + "paths": ["package.json"], +``` + ### sourceUrlPrefixes Here's an example of where you use this to group together all packages from the Vue monorepo: