Skip to content

Commit b922205

Browse files
authored
Merge pull request #1512 from swiftwasm/maxd/fix-nightly-distribution
Fix run filtering in nightly distribution script
2 parents b38a897 + 3b5cad0 commit b922205

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/webassembly/distribute-latest-toolchain.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ github() {
1111
curl --header "authorization: Bearer $GITHUB_TOKEN" "$@"
1212
}
1313

14-
latest_run=$(github "${gh_api}/repos/${repository}/actions/workflows/${workflow_name}/runs?branch=${branch}&status=completed" | jq '.workflow_runs | sort_by(.run_number) | last')
14+
latest_run=$(github "${gh_api}/repos/${repository}/actions/workflows/${workflow_name}/runs?head_branch=${branch}&status=completed&conclusion=success" \
15+
| jq ".workflow_runs | map(select(.head_branch == \"$branch\")) | sort_by(.run_number) | last")
1516
artifacts_url=$(echo $latest_run | jq .artifacts_url --raw-output)
1617
head_sha=$(echo $latest_run | jq .head_sha --raw-output)
1718

18-
1919
get_artifact_url() {
2020
local name=$1
2121
github $artifacts_url --fail | jq ".artifacts[] | select(.name == \"$name\") | .archive_download_url" | sed 's/\"//g'

0 commit comments

Comments
 (0)