Skip to content

Commit 4bc7ad3

Browse files
committed
improve release workflow to allow incompleted ones as well
1 parent 2e82c6f commit 4bc7ad3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/release_interpret.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ jobs:
4646
echo "Commit ID: ${commit_id}"
4747
workflow_runs=$(gh api -X GET "/repos/${{ github.repository }}/actions/runs?status=success" -q '.workflow_runs | map(select(.head_commit.id == "'"${commit_id}"'" and .name == "interpret-CI")) | sort_by(.created_at) | reverse | .[0]')
4848
run_id=$(echo "$workflow_runs" | jq -r '.id')
49+
if [[ -z "$run_id" || "$run_id" == "null" ]]; then
50+
echo "No successful run found – looking for the last failed run."
51+
workflow_runs=$(gh api -X GET "/repos/${{ github.repository }}/actions/runs" -q '.workflow_runs | map(select(.head_commit.id == "'"${commit_id}"'" and .name == "interpret-CI")) | sort_by(.created_at) | reverse | .[0]')
52+
run_id=$(echo "$workflow_runs" | jq -r '.id')
53+
fi
4954
echo "Run ID: ${run_id}"
5055
echo "run_id=${run_id}" >> $GITHUB_ENV
5156
env:

0 commit comments

Comments
 (0)