diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 862fc39935e064..82061dc96c13d4 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -932,7 +932,7 @@ At other times, the possible files is too vague for Renovate to have any default For default, Kubernetes manifests can exist in any `*.yaml` file and we don't want Renovate to parse every single YAML file in every repository just in case some of them have a Kubernetes manifest, so Renovate's default `fileMatch` for manager `kubernetes` is actually empty (`[]`) and needs the user to tell Renovate what directories/files to look in. Finally, there are cases where Renovate's default `fileMatch` is good, but you may be using file patterns that a bot couldn't possibly guess about. -For example, Renovate's default `fileMatch` for `Dockerfile` is `['(^|/|\\.)Dockerfile$', '(^|/)Dockerfile[^/]*$']`. +For example, Renovate's default `fileMatch` for `Dockerfile` is `['(^|/|\\.)([Dd]ocker|[Cc]ontainer)file$', '(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$']`. This will catch files like `backend/Dockerfile`, `prefix.Dockerfile` or `Dockerfile-suffix`, but it will miss files like `ACTUALLY_A_DOCKERFILE.template`. Because `fileMatch` is mergeable, you don't need to duplicate the defaults and could just add the missing file like this: diff --git a/lib/modules/manager/dockerfile/index.ts b/lib/modules/manager/dockerfile/index.ts index 0e011c1730d1d4..febfd35a2a88d6 100644 --- a/lib/modules/manager/dockerfile/index.ts +++ b/lib/modules/manager/dockerfile/index.ts @@ -8,8 +8,8 @@ export { extractPackageFile }; export const defaultConfig = { fileMatch: [ - '(^|/|\\.)(Docker|Container)file$', - '(^|/)(Docker|Container)file[^/]*$', + '(^|/|\\.)([Dd]ocker|[Cc]ontainer)file$', + '(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$', ], }; diff --git a/lib/workers/repository/extract/extract-fingerprint-config.spec.ts b/lib/workers/repository/extract/extract-fingerprint-config.spec.ts index 76977db7552183..c0ac40404f4e46 100644 --- a/lib/workers/repository/extract/extract-fingerprint-config.spec.ts +++ b/lib/workers/repository/extract/extract-fingerprint-config.spec.ts @@ -100,8 +100,8 @@ describe('workers/repository/extract/extract-fingerprint-config', () => { enabled: true, fileList: [], fileMatch: [ - '(^|/|\\.)(Docker|Container)file$', - '(^|/)(Docker|Container)file[^/]*$', + '(^|/|\\.)([Dd]ocker|[Cc]ontainer)file$', + '(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$', ], ignorePaths: ['**/node_modules/**', '**/bower_components/**'], includePaths: [],