Skip to content

Commit

Permalink
Add isNewAction and isRepositoryActions (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakov116 committed Sep 30, 2020
1 parent e2cdc4c commit d7c3637
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,17 @@ collect.set('isActionJobRun', [
'https://github.com/sindresorhus/refined-github/runs/639481849',
]);

export const isNewAction = (url: URL | Location = location): boolean => String(getRepoPath(url)) === 'actions/new';
collect.set('isNewAction', [
'https://github.com/sindresorhus/refined-github/actions/new',
]);

export const isRepositoryActions = (url: URL | Location = location): boolean => String(getRepoPath(url)).startsWith('actions');
collect.set('isRepositoryActions', [
'https://github.com/fregante/github-url-detection/actions',
'https://github.com/sindresorhus/refined-github/actions/new',
]);

export const canUserEditOrganization = (): boolean => isOrganizationProfile() && exists('.pagehead-tabs-item[href$="/settings/profile"]');

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

0 comments on commit d7c3637

Please sign in to comment.