Skip to content

Commit d7c3637

Browse files
authored
Add isNewAction and isRepositoryActions (#43)
1 parent e2cdc4c commit d7c3637

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,17 @@ collect.set('isActionJobRun', [
453453
'https://github.com/sindresorhus/refined-github/runs/639481849',
454454
]);
455455

456+
export const isNewAction = (url: URL | Location = location): boolean => String(getRepoPath(url)) === 'actions/new';
457+
collect.set('isNewAction', [
458+
'https://github.com/sindresorhus/refined-github/actions/new',
459+
]);
460+
461+
export const isRepositoryActions = (url: URL | Location = location): boolean => String(getRepoPath(url)).startsWith('actions');
462+
collect.set('isRepositoryActions', [
463+
'https://github.com/fregante/github-url-detection/actions',
464+
'https://github.com/sindresorhus/refined-github/actions/new',
465+
]);
466+
456467
export const canUserEditOrganization = (): boolean => isOrganizationProfile() && exists('.pagehead-tabs-item[href$="/settings/profile"]');
457468

458469
export const canUserEditRepo = (): boolean => isRepo() && exists('.reponav-item[href$="/settings"], [data-tab-item="settings-tab"]');

0 commit comments

Comments
 (0)