From 18ddc2fe74011f5dda0ced239b46fefeeb6ca4f6 Mon Sep 17 00:00:00 2001
From: Boris Bera <dotboris@users.noreply.github.com>
Date: Wed, 3 May 2023 15:05:39 -0400
Subject: [PATCH] feat(manager/dockerfile): support file names that are all
 lowercase (#21877)

---
 docs/usage/configuration-options.md                           | 2 +-
 lib/modules/manager/dockerfile/index.ts                       | 4 ++--
 .../repository/extract/extract-fingerprint-config.spec.ts     | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md
index 862fc39935..82061dc96c 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 0e011c1730..febfd35a2a 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 76977db755..c0ac40404f 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: [],
-- 
GitLab