diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 7f14d471c40e44511ca562c76aeb9b4d784c12fd..848c3600a439e36790dc3a10555a4603f3632bd9 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2394,7 +2394,7 @@ The matching process for a package rule: - If no match/exclude matchers are defined, everything matches. - If an aspect is both `match`ed and `exclude`d, the exclusion wins. - Multiple values within a single matcher will be evaluated independently (they're OR-ed together). -- Combining multiple matchers will restrict the resulting matches (they're AND-ed together): +- Combining multiple matchers will restrict the resulting matches (they're AND-ed together): `matchCurrentVersion`, `matchCurrentValue`, `matchNewValue`, `matchConfidence`, `matchCurrentAge`, `matchManagers`, `matchDatasources`, `matchCategories`, `matchDepTypes`, `matchUpdateTypes`, `matchRepositories`/`excludeRepositories`, `matchBaseBranches`, `matchFileNames` @@ -3232,6 +3232,42 @@ For example to replace the npm package `jade` with version `2.0.0` of the packag } ``` +### sourceUrl + +Use this field to set the source URL for a package, including overriding an existing one. +Source URLs are necessary to link to the source of the package and in order to look up changelogs. + +```json title="Setting the source URL for the dummy package" +{ + "packageRules": [ + { + "matchPackageNames": ["dummy"], + "sourceUrl": "https://github.com/org/dummy" + } + ] +} +``` + +### sourceDirectory + +Use this field to set the directory in which the package is present at the source of the package. + +```json title="Setting the source directory for the kube-prometheus package from bitnami charts repo" +{ + "packageRules": [ + { + "matchPackageNames": ["dummy"], + "sourceUrl": "https://github.com/bitnami/charts", + "sourceDirectory": "bitnami/kube-prometheus" + } + ] +} +``` + +<!-- prettier-ignore --> +!!! note + `sourceDirectory` should be only be configured along with `sourceUrl`. + ### prPriority Sometimes Renovate needs to rate limit its creation of PRs, e.g. hourly or concurrent PR limits. diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 9485956f2ea8765251cbf7a471f7d8bb7aa8a9c7..98479dae8c7ac89c328015497a5539a6fc783330 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1562,6 +1562,23 @@ const options: RenovateOptions[] = [ cli: false, env: false, }, + { + name: 'sourceUrl', + description: 'The source URL of the package.', + type: 'string', + parents: ['packageRules'], + cli: false, + env: false, + }, + { + name: 'sourceDirectory', + description: + 'The source directory in which the package is present at its source.', + type: 'string', + parents: ['packageRules'], + cli: false, + env: false, + }, { name: 'matchSourceUrlPrefixes', description: