From 075220757514a22e8718cf4bf768807a3ab01915 Mon Sep 17 00:00:00 2001 From: Thomas Schersach Date: Wed, 22 May 2024 17:53:46 +0200 Subject: [PATCH] chore: branch is available when even is workflow_dispatch (#137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Eric Büttner --- dist/index.js | 4 ++-- find-successful-workflow.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 974c09b..55d2d3b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -37976,8 +37976,8 @@ function findSuccessfulCommit(workflow_id, run_id, owner, repo, branch, lastSucc .request(`GET /repos/${owner}/${repo}/actions/workflows/${workflow_id}/runs`, { owner, repo, - // on non-push workflow runs we do not have branch property - branch: lastSuccessfulEvent !== "push" ? undefined : branch, + // on some workflow runs we do not have branch property + branch: lastSuccessfulEvent === "push" || lastSuccessfulEvent === "workflow_dispatch" ? branch : undefined, workflow_id, event: lastSuccessfulEvent, status: "success", diff --git a/find-successful-workflow.ts b/find-successful-workflow.ts index 788cbcc..a0e1ee1 100644 --- a/find-successful-workflow.ts +++ b/find-successful-workflow.ts @@ -172,8 +172,8 @@ async function findSuccessfulCommit( { owner, repo, - // on non-push workflow runs we do not have branch property - branch: lastSuccessfulEvent !== "push" ? undefined : branch, + // on some workflow runs we do not have branch property + branch: lastSuccessfulEvent === "push" || lastSuccessfulEvent === "workflow_dispatch" ? branch : undefined, workflow_id, event: lastSuccessfulEvent, status: "success",