Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Commit

Permalink
Also filteer non pr and push events
Browse files Browse the repository at this point in the history
  • Loading branch information
n1hility committed Feb 19, 2020
1 parent a38415f commit beb7c0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Expand Up @@ -1546,7 +1546,8 @@ function cancelDuplicates(token, selfRunId, owner, repo, workflowId, branch, eve
matched = true;
core.info(`Matched ${selfRunId}`);
}
if ('completed' === element.status.toString()) {
if ('completed' === element.status.toString() ||
!['push', 'pull_request'].includes(element.event.toString)) {
continue;
}
// This is a set of one in the non-schedule case, otherwise everything is a candidate
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Expand Up @@ -109,7 +109,10 @@ async function cancelDuplicates(
core.info(`Matched ${selfRunId}`)
}

if ('completed' === element.status.toString()) {
if (
'completed' === element.status.toString() ||
!['push', 'pull_request'].includes(element.event.toString)
) {
continue
}

Expand Down

0 comments on commit beb7c0e

Please sign in to comment.