Skip to content

Commit 0680f01

Browse files
fix: proceed on checkless regen PRs in wait_for_checks
Speakeasy regen PRs are opened with the workflow GITHUB_TOKEN, which by design does not trigger downstream on: pull_request runs, so they carry zero status checks. main has no required checks either, so gh pr merge --auto no-ops and the direct-merge fallback calls wait_for_checks. The empty-rollup arm only `continue`d, so TOTAL stayed 0 until the 600s timeout and the function exit 1'd — failing auto-merge on every regen PR. Add a 60s grace window for checks to register, then treat a persistently empty rollup as "no checks to wait for" and return 0 so the direct squash merge proceeds. Matches the fix already shipped in go-sdk #318.
1 parent 186c107 commit 0680f01

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/auto-merge-speakeasy-pr.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ jobs:
159159
'[.statusCheckRollup[]? | select(.status == "COMPLETED") | select(.conclusion != "SUCCESS" and .conclusion != "SKIPPED" and .conclusion != "NEUTRAL")] | length')
160160
161161
if [ "$TOTAL" -eq 0 ]; then
162+
# GITHUB_TOKEN-authored regen PRs get no pull_request checks at all,
163+
# so TOTAL stays 0 forever. Wait a short grace window in case checks
164+
# are merely slow to register, then proceed rather than time out.
165+
if [ "$elapsed" -ge 60 ]; then
166+
echo "No checks registered after ${elapsed}s — proceeding (checkless PR)"
167+
return 0
168+
fi
162169
echo "Checks not yet registered — waiting ${interval}s..."
163170
sleep "$interval"
164171
elapsed=$((elapsed + interval))

0 commit comments

Comments
 (0)