File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 version : ${{ steps.v.outputs.version }}
2222 tag : ${{ steps.v.outputs.tag }}
2323 steps :
24+ - name : Skip if another release run is already in progress
25+ env :
26+ GH_TOKEN : ${{ github.token }}
27+ SELF_ID : ${{ github.run_id }}
28+ REPO : ${{ github.repository }}
29+ shell : bash
30+ run : |
31+ set -euo pipefail
32+ others=$(gh run list -R "$REPO" --workflow=release.yml --status=in_progress \
33+ --json databaseId --jq ".[] | select(.databaseId != ${SELF_ID}) | .databaseId" \
34+ || true)
35+ if [ -n "$others" ]; then
36+ echo "::notice title=Release skipped::another release run is already in progress ($others); cancelling self"
37+ gh run cancel "$SELF_ID" -R "$REPO" || true
38+ # Block until the cancel takes effect so downstream jobs don't run.
39+ sleep 120
40+ exit 1
41+ fi
2442 - uses : actions/checkout@v4
2543 - id : v
2644 shell : bash
You can’t perform that action at this time.
0 commit comments