From 9a1d98cc1b23110e570f29e5bb8527e77cefa67c Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Fri, 13 May 2022 08:07:01 +0200
Subject: [PATCH] fix(changelog): massage links case insensitive (#15570)

---
 lib/modules/platform/github/massage-markdown-links.spec.ts | 1 +
 lib/modules/platform/github/massage-markdown-links.ts      | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/modules/platform/github/massage-markdown-links.spec.ts b/lib/modules/platform/github/massage-markdown-links.spec.ts
index 93564ab31a..0f24fff9e7 100644
--- a/lib/modules/platform/github/massage-markdown-links.spec.ts
+++ b/lib/modules/platform/github/massage-markdown-links.spec.ts
@@ -62,6 +62,7 @@ describe('modules/platform/github/massage-markdown-links', () => {
     ${'github.com/foo/bar/discussions/1'}                                                     | ${'[github.com/foo/bar/discussions/1](togithub.com/foo/bar/discussions/1)'}
     ${'github.com/foo/bar/issues/1'}                                                          | ${'[github.com/foo/bar/issues/1](togithub.com/foo/bar/issues/1)'}
     ${'github.com/foo/bar/pull/1'}                                                            | ${'[github.com/foo/bar/pull/1](togithub.com/foo/bar/pull/1)'}
+    ${'github.com/Foo/bar/pull/1'}                                                            | ${'[github.com/Foo/bar/pull/1](togithub.com/Foo/bar/pull/1)'}
     ${'www.github.com/foo/bar/discussions/1'}                                                 | ${'[www.github.com/foo/bar/discussions/1](www.togithub.com/foo/bar/discussions/1)'}
     ${'www.github.com/foo/bar/issues/1'}                                                      | ${'[www.github.com/foo/bar/issues/1](www.togithub.com/foo/bar/issues/1)'}
     ${'www.github.com/foo/bar/pull/1'}                                                        | ${'[www.github.com/foo/bar/pull/1](www.togithub.com/foo/bar/pull/1)'}
diff --git a/lib/modules/platform/github/massage-markdown-links.ts b/lib/modules/platform/github/massage-markdown-links.ts
index c55a1eba8e..15b0ba3a81 100644
--- a/lib/modules/platform/github/massage-markdown-links.ts
+++ b/lib/modules/platform/github/massage-markdown-links.ts
@@ -35,7 +35,7 @@ function collectLinkPosition(input: string, matches: UrlMatch[]): Plugin {
         });
       }
     } else if (tree.type === 'text') {
-      const globalUrlReg = new RegExp(urlRegex, 'g');
+      const globalUrlReg = new RegExp(urlRegex, 'gi');
       const urlMatches = [...tree.value.matchAll(globalUrlReg)];
       for (const match of urlMatches) {
         const [url] = match;
-- 
GitLab