Skip to content

Commit 70f6604

Browse files
hardikmodhafregante
andcommitted
Add tag-changelog-link feature (#1998)
Co-authored-by: Federico Brigante <github@bfred.it>
1 parent be4ab51 commit 70f6604

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

source/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ export const isTrending = (): boolean => location.pathname === '/trending' || lo
9797

9898
export const isUserProfile = (): boolean => select.exists('.user-profile-nav');
9999

100+
export const isSingleTagPage = (): boolean => /^(releases\/tag)/.test(getRepoPath()!);
101+
100102
export const hasComments = (): boolean =>
101103
isPR() ||
102104
isIssue() ||

test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,3 +380,13 @@ test('isRepoSearch', urlMatcherMacro, pageDetect.isRepoSearch, [
380380
'https://github.com/sindresorhus/search',
381381
'https://github.com/search'
382382
]);
383+
384+
test('isSingleTagPage', urlMatcherMacro, pageDetect.isSingleTagPage, [
385+
'https://github.com/sindresorhus/refined-github/releases/tag/v1.0.0-beta.4',
386+
'https://github.com/sindresorhus/refined-github/releases/tag/0.2.1'
387+
], [
388+
'https://github.com/sindresorhus/refined-github/tags',
389+
'https://github.com/sindresorhus/refined-github/releases',
390+
'https://github.com/sindresorhus/refined-github',
391+
'https://github.com/sindresorhus/refined-github/graphs'
392+
]);

0 commit comments

Comments
 (0)