From bea601ac767176657be5759d9e4603b1c727c622 Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Sat, 25 Jul 2026 19:43:03 -0700 Subject: [PATCH] Skip the pointless final-attempt rebuild; stop misattributing push failures Copilot's two review points: the fifth attempt performed a full reset + install + rebuild + 25s backoff that nothing would ever consume before the job failed, and the retry message blamed "main advanced" when the combined condition also fails on push errors (network, auth). The loop now breaks before recovery on the final attempt, and both the retry and terminal messages name the two possible causes. Prepared with AI assistance (Claude Code), directed by @pbakaus. Co-Authored-By: Claude Code --- .github/workflows/sync-generated-output.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-generated-output.yml b/.github/workflows/sync-generated-output.yml index 41f564232..f77998922 100644 --- a/.github/workflows/sync-generated-output.yml +++ b/.github/workflows/sync-generated-output.yml @@ -107,14 +107,19 @@ jobs: exit 0 fi - echo "main advanced during attempt $attempt; re-syncing and rebuilding." + # The recovery work is pointless on the final attempt: nothing + # would consume the rebuild, and the backoff would only delay + # the failure. + if [ "$attempt" = 5 ]; then break; fi + + echo "Push did not land on attempt $attempt (main advanced, or the push itself failed); re-syncing and rebuilding." git reset --hard origin/main bun install --frozen-lockfile bun run build:release sleep $((attempt * 5)) done - echo "::error::main kept advancing through 5 sync attempts; rerun this workflow on the latest main." + echo "::error::Could not push generated output after 5 attempts (main kept advancing, or pushes kept failing); rerun this workflow on the latest main." exit 1 - name: Summarize generated output commit