Skip to content

Commit fe56a07

Browse files
committed
Wait for in-progress CI runs before releasing
The release check treated runs with an empty conclusion as failures. Now it inspects each run's status and aborts with an error if any CI check is still running, so releases wait until CI completes.
1 parent 907257f commit fe56a07

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

scripts/release.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ HEAD_SHORT=$(git rev-parse --short HEAD)
6262
echo " Latest commit: $HEAD_SHORT"
6363

6464
# Fetch all workflow runs for the HEAD commit
65-
RUNS=$(gh run list --commit "$HEAD_SHA" --json name,conclusion,headSha)
65+
RUNS=$(gh run list --commit "$HEAD_SHA" --json name,status,conclusion,headSha)
6666

6767
NUM_RUNS=$(echo "$RUNS" | jq 'length')
6868

@@ -75,8 +75,17 @@ fi
7575
echo " Found $NUM_RUNS workflow run(s):"
7676

7777
FAILED=0
78+
RUNNING=0
7879
ABIDIFF_PASSED=0
79-
while IFS=$'\t' read -r name conclusion; do
80+
while IFS=$'\t' read -r name status conclusion; do
81+
# A run that hasn't completed yet has an empty conclusion; don't treat it
82+
# as a failure — the release should wait until CI finishes.
83+
if [ "$status" != "completed" ]; then
84+
echo " [ .. ] $name (still running)"
85+
RUNNING=1
86+
continue
87+
fi
88+
8089
if [[ "$name" == *abidiff* ]] || [[ "$name" == *abi* && "$name" != *stability* ]]; then
8190
if [ "$conclusion" = "success" ]; then
8291
echo " [ OK ] $name"
@@ -94,7 +103,13 @@ while IFS=$'\t' read -r name conclusion; do
94103
echo " [FAIL] $name ($conclusion)"
95104
FAILED=1
96105
fi
97-
done < <(echo "$RUNS" | jq -r '.[] | [.name, .conclusion] | @tsv')
106+
done < <(echo "$RUNS" | jq -r '.[] | [.name, .status, .conclusion] | @tsv')
107+
108+
if [ "$RUNNING" -eq 1 ]; then
109+
echo ""
110+
echo "Error: Some CI checks are still running. Wait for them to complete before releasing."
111+
exit 1
112+
fi
98113

99114
if [ "$FAILED" -eq 1 ]; then
100115
echo ""

0 commit comments

Comments
 (0)