From 8e1d8159ad19252e79a93e360cfe45f86ec75aad Mon Sep 17 00:00:00 2001 From: Thomas Aribart <38014240+ThomasAribart@users.noreply.github.com> Date: Tue, 21 Jun 2022 16:00:29 +0200 Subject: [PATCH] feat: remove branch filter in runs search when event is of type release (#44) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: remove branch filter in runs search when event is of type release * Update find-successful-workflow.js Co-authored-by: Miroslav Jonaš --- find-successful-workflow.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/find-successful-workflow.js b/find-successful-workflow.js index 8dca4eb..d4b17c3 100644 --- a/find-successful-workflow.js +++ b/find-successful-workflow.js @@ -97,7 +97,8 @@ async function findSuccessfulCommit(workflow_id, run_id, owner, repo, branch, la const shas = await octokit.request(`GET /repos/${owner}/${repo}/actions/workflows/${workflow_id}/runs`, { owner, repo, - branch, + // on release workflow runs do not have branch property + branch: lastSuccessfulEvent === 'release' ? undefined : branch, workflow_id, event: lastSuccessfulEvent, status: 'success'