Skip to content

Commit bfea294

Browse files
Workaround: remove status parameter from GitHub Actions API call
1 parent f588be1 commit bfea294

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

utils/webassembly/distribute-latest-toolchain.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ github() {
2323
curl --header "authorization: Bearer $GITHUB_TOKEN" "$@"
2424
}
2525

26-
latest_run=$(github "${gh_api}/repos/${repository}/actions/workflows/${workflow_name}/runs?branch=${branch}&status=success" \
27-
| jq ".workflow_runs | map(select(.head_branch == \"$branch\")) | sort_by(.run_number) | last")
26+
# workaround: if status=success option is given, the API doesn't return the latest runs list, so remove it temporarily.
27+
latest_run=$(github "${gh_api}/repos/${repository}/actions/workflows/${workflow_name}/runs?branch=${branch}" \
28+
| jq ".workflow_runs | map(select(.head_branch == \"$branch\")) | map(select(.conclusion == \"success\")) | sort_by(.run_number) | last")
2829

2930
if [ -z "$latest_run" ] || [ "$latest_run" == "null" ]; then
3031
echo "No successful runs available"

0 commit comments

Comments
 (0)