File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 46
46
echo "Commit ID: ${commit_id}"
47
47
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]')
48
48
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
49
54
echo "Run ID: ${run_id}"
50
55
echo "run_id=${run_id}" >> $GITHUB_ENV
51
56
env :
You can’t perform that action at this time.
0 commit comments