Revert "fix: making the github urls case insensitive" (#32220)

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
Ben Lambert
2025-12-29 14:11:46 +01:00
committed by GitHub
parent fea3e3972d
commit 9083273931
3 changed files with 6 additions and 23 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/integration': patch
---
Rollback the lowercase replacing in GitHub integration config
@@ -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');
});
});
@@ -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}/`;
},
);
}