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 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 :
You can’t perform that action at this time.
0 commit comments