Skip to content

Commit 5547b91

Browse files
committed
fix(ci): keep polling while nested test jobs have not appeared yet
An in-progress push run lists its reusable-workflow jobs only after the caller starts; nojobs is now terminal (fail closed) only once the run has completed without them.
1 parent 3e63380 commit 5547b91

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,18 @@ jobs:
116116
elif any($t[]; .conclusion != null and .conclusion != "success") then "failed"
117117
else "pending" end' 2>/dev/null || echo pending)"
118118
if [ "$STATE" = "nojobs" ]; then
119-
# Fail closed: no jobs matching the "Test and Build /" prefix
120-
# means the reusable-workflow job name changed (or tests were
121-
# skipped) — never infer coverage from the overall run
122-
# conclusion. Update the prefix here if test-build is renamed.
123-
echo "Push run ${RUN_ID} has no 'Test and Build /' jobs — running tests in this PR run (update the prefix if the job was renamed)."
124-
break
119+
# Nested reusable-workflow jobs appear only after the caller
120+
# starts, so an in-progress run with no "Test and Build /"
121+
# jobs yet just needs another poll. Once the run has
122+
# COMPLETED without them, fail closed: the job was renamed or
123+
# tests were skipped — never infer coverage from the overall
124+
# run conclusion. Update the prefix here on a rename.
125+
RUN_STATUS="$(printf '%s' "$RUN_JSON" | jq -r '.workflow_runs[0].status // "unknown"' 2>/dev/null || echo unknown)"
126+
if [ "$RUN_STATUS" = "completed" ]; then
127+
echo "Push run ${RUN_ID} completed with no 'Test and Build /' jobs — running tests in this PR run (update the prefix if the job was renamed)."
128+
break
129+
fi
130+
STATE="pending"
125131
fi
126132
if [ "$STATE" = "success" ]; then
127133
# (3) Re-verify merge-tree equivalence against the LIVE base

0 commit comments

Comments
 (0)