Skip to content

Commit 47abac3

Browse files
josephnefclaude
andcommitted
ci: guard the sweep's run listing so it cannot fail a passing gate
The sweep step promised best-effort but only protected the reruns — with pipefail set, a transient failure of the run listing itself would have been the step's exit code, turning a PASS into a FAIL. The listing is now guarded and the step exits 0 on every path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d83754b commit 47abac3

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/qodo-gate.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,19 @@ jobs:
160160
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
161161
THIS_RUN: ${{ github.run_id }}
162162
run: |
163-
set -uo pipefail
164-
gh run list --repo "$REPO" --workflow qodo-gate \
163+
set -u
164+
# The listing is guarded too, not just the reruns: with an unguarded
165+
# pipeline a transient list failure would be the step's exit code —
166+
# exactly the PASS-into-FAIL this step promises not to produce.
167+
if ! ids=$(gh run list --repo "$REPO" --workflow qodo-gate \
165168
--commit "$HEAD_SHA" --json databaseId,conclusion \
166-
--jq '.[] | select(.conclusion == "failure") | .databaseId' |
167-
while read -r id; do
169+
--jq '.[] | select(.conclusion == "failure") | .databaseId'); then
170+
echo "sweep skipped: could not list this workflow's runs"
171+
exit 0
172+
fi
173+
for id in $ids; do
168174
[ "$id" = "$THIS_RUN" ] && continue
169175
echo "re-running failed qodo-gate run $id"
170176
gh run rerun "$id" --repo "$REPO" --failed || true
171177
done
178+
exit 0

0 commit comments

Comments
 (0)