Skip to content

Commit bed6ea1

Browse files
authored
Merge pull request #1673 from swiftwasm/maxd/fix-latest-run-check
Fix latest run check in toolchain upload script Currently, if there are no recent successful runs on GitHub Actions, the toolchain distribution script fails. Because of this the 5.3 toolchains are not uploaded even if there are successful runs for those. We should check for this scenario and just stop the script with `0` exit code to allow the 5.3 upload to proceed.
2 parents fa38512 + 4469708 commit bed6ea1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

utils/webassembly/distribute-latest-toolchain.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ github() {
1313

1414
latest_run=$(github "${gh_api}/repos/${repository}/actions/workflows/${workflow_name}/runs?head_branch=${branch}&status=completed&conclusion=success" \
1515
| jq ".workflow_runs | map(select(.head_branch == \"$branch\")) | sort_by(.run_number) | last")
16+
17+
if [ -z "$latest_run" ] || [ "$latest_run" == "null" ]; then
18+
echo "No successful runs available"
19+
exit 0
20+
fi
21+
1622
artifacts_url=$(echo $latest_run | jq .artifacts_url --raw-output)
1723
head_sha=$(echo $latest_run | jq .head_sha --raw-output)
1824

0 commit comments

Comments
 (0)