diff --git a/dist/index.js b/dist/index.js index ac890d9..08cf9c8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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 diff --git a/src/main.ts b/src/main.ts index 560f836..2321b22 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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 }