Skip to content

Commit 5c5182a

Browse files
update isPRCommit to handle new urls
1 parent 48af931 commit 5c5182a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,13 @@ TEST: addTests('isPRList', [
254254
'https://github.com/sindresorhus/refined-github/pulls?q=is%3Apr+is%3Aclosed',
255255
]);
256256

257-
export const isPRCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/commits\/[\da-f]{5,40}$/.test(getRepo(url)?.path);
257+
export const isPRCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/(commits|changes)\/[\da-f]{5,40}$/.test(getRepo(url)?.path);
258258
TEST: addTests('isPRCommit', [
259259
'https://github.com/sindresorhus/refined-github/pull/148/commits/0019603b83bd97c2f7ef240969f49e6126c5ec85',
260260
'https://github.com/sindresorhus/refined-github/pull/148/commits/00196',
261+
// Since December 2025
262+
'https://github.com/sindresorhus/refined-github/pull/148/changes/0019603b83bd97c2f7ef240969f49e6126c5ec85',
263+
'https://github.com/sindresorhus/refined-github/pull/148/changes/00196',
261264
]);
262265

263266
export const isPRCommit404 = (): boolean => isPRCommit() && document.title.startsWith('Commit range not found · Pull Request');

0 commit comments

Comments
 (0)