Skip to content

Commit

Permalink
fix: skip logic
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Mar 14, 2020
1 parent 78a39ce commit 01976c9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,17 @@ export async function skipOnFork(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(context.payload as any).repository.fork === 'true';

if (isForkRepository && deployKey === '') {
core.warning('Action runs on fork and deploy_key is empty');
return true;
}
if (isForkRepository) {
if (githubToken) {
return false;
}

if (isForkRepository && personalToken === '') {
core.warning('Action runs on fork and personalToken is empty');
return true;
if (!deployKey && !personalToken) {
core.warning(
'Action runs on fork and deploy_key or personal_token is empty'
);
return true;
}
}

return false;
Expand Down

0 comments on commit 01976c9

Please sign in to comment.