From 9083273931b80988ab26db19269cda2a3a360a99 Mon Sep 17 00:00:00 2001 From: Ben Lambert Date: Mon, 29 Dec 2025 14:11:46 +0100 Subject: [PATCH] Revert "fix: making the github urls case insensitive" (#32220) Signed-off-by: benjdlambert --- .changeset/polite-pillows-accept.md | 5 +++++ .../src/github/GithubIntegration.test.ts | 20 ------------------- .../src/github/GithubIntegration.ts | 4 +--- 3 files changed, 6 insertions(+), 23 deletions(-) create mode 100644 .changeset/polite-pillows-accept.md diff --git a/.changeset/polite-pillows-accept.md b/.changeset/polite-pillows-accept.md new file mode 100644 index 0000000000..ece7c02ee1 --- /dev/null +++ b/.changeset/polite-pillows-accept.md @@ -0,0 +1,5 @@ +--- +'@backstage/integration': patch +--- + +Rollback the lowercase replacing in GitHub integration config diff --git a/packages/integration/src/github/GithubIntegration.test.ts b/packages/integration/src/github/GithubIntegration.test.ts index c54d4db2ef..70f1c4a16c 100644 --- a/packages/integration/src/github/GithubIntegration.test.ts +++ b/packages/integration/src/github/GithubIntegration.test.ts @@ -134,24 +134,4 @@ describe('replaceGithubUrlType', () => { ), ).toBe('https://github.com/backstage/backstage/blob/tree/README.md'); }); - it('should replace with lowercase', () => { - expect( - replaceGithubUrlType( - 'https://githuB.com/backstage/backstage/blob/master/README.md', - 'edit', - ), - ).toBe('https://github.com/backstage/backstage/edit/master/README.md'); - expect( - replaceGithubUrlType( - 'https://github.com/Backstage/backstage/blob/master/README.md', - 'edit', - ), - ).toBe('https://github.com/backstage/backstage/edit/master/README.md'); - expect( - replaceGithubUrlType( - 'https://github.com/backstage/Backstage/blob/master/README.md', - 'edit', - ), - ).toBe('https://github.com/backstage/backstage/edit/master/README.md'); - }); }); diff --git a/packages/integration/src/github/GithubIntegration.ts b/packages/integration/src/github/GithubIntegration.ts index 79d5e7f421..880a2bed21 100644 --- a/packages/integration/src/github/GithubIntegration.ts +++ b/packages/integration/src/github/GithubIntegration.ts @@ -95,9 +95,7 @@ export function replaceGithubUrlType( return url.replace( /\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//, (_, host, owner, repo) => { - return `//${host.toLocaleLowerCase('en-US')}/${owner.toLocaleLowerCase( - 'en-US', - )}/${repo.toLocaleLowerCase('en-US')}/${type}/`; + return `//${host}/${owner}/${repo}/${type}/`; }, ); }