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 <noreply@anthropic.com>
This commit is contained in:
Paul Bakaus
2026-07-25 19:43:03 -07:00
co-authored by Claude Code
parent dfd7f9636d
commit bea601ac76
+7 -2
View File
@@ -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