Skip to content

Commit 908ea29

Browse files
isPRFiles - Handle new URL format (#213)
1 parent f4cf13a commit 908ea29

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,16 @@ TEST: addTests('isPRCommitList', [
276276
'https://github.com/sindresorhus/refined-github/pull/148/commits',
277277
]);
278278

279-
export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/files/.test(getRepo(url)?.path) || isPRCommit(url);
279+
export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/(files|(changes(\/[\da-f]{7,40}..[\da-f]{7,40})?$))/.test(getRepo(url)?.path) || isPRCommit(url);
280280
TEST: addTests('isPRFiles', [
281281
'isPRCommit', // File contents but lacks "Viewed" checkbox, has commit information
282282
'https://github.com/sindresorhus/refined-github/pull/148/files',
283283
'https://github.com/sindresorhus/refined-github/pull/148/files/e1aba6f', // This means "every commit until e1aba6f"
284284
'https://github.com/sindresorhus/refined-github/pull/148/files/1e27d799..e1aba6f', // This means specifically "Between commit A and B"
285+
// Since December 2025
286+
'https://github.com/refined-github/refined-github/pull/148/changes',
287+
'https://github.com/refined-github/refined-github/pull/148/changes/1e27d799..e1aba6f', // This means specifically "Between commit A and B"
288+
'https://github.com/refined-github/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641..e1aba6febb3fe38aafd1137cff28b536eeeabe7e',
285289
]);
286290

287291
export const isQuickPR = (url: URL | HTMLAnchorElement | Location = location): boolean => isCompare(url) && /[?&]quick_pull=1(&|$)/.test(url.search);

0 commit comments

Comments
 (0)