From afb8662d4db079eb206ea2c882ed6cec51f46546 Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 30 Jul 2021 13:32:22 -0500 Subject: [PATCH] Query artifacts by branch name (#3881) This way workflows will still work even if there have been enough runs to push the version branch run off the first page. --- ci/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/lib.sh b/ci/lib.sh index 5021f99e..c7b5a420 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -57,8 +57,8 @@ arch() { # https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs get_artifacts_url() { local artifacts_url - local workflow_runs_url="repos/:owner/:repo/actions/workflows/ci.yaml/runs?event=pull_request" local version_branch="v$VERSION" + local workflow_runs_url="repos/:owner/:repo/actions/workflows/ci.yaml/runs?event=pull_request&branch=$version_branch" artifacts_url=$(gh api "$workflow_runs_url" | jq -r ".workflow_runs[] | select(.head_branch == \"$version_branch\") | .artifacts_url" | head -n 1) if [[ -z "$artifacts_url" ]]; then echo >&2 "ERROR: artifacts_url came back empty"