From 35a48ac8684cb8e64033829360367b06e133dba4 Mon Sep 17 00:00:00 2001 From: Rootiest Date: Tue, 22 Sep 2026 22:54:47 -0400 Subject: [PATCH] ci: retry the generated-docs push through a rebase on rejection build-docs's auto-commit step was seen rejected as non-fast-forward (run 976, sha 3bbda31): npm ci + astro build + the Cloudflare Pages deploy ahead of it can take several minutes, long enough for another PR to merge into main first. A bare `git push` has no way to recover from that -- the whole job just fails, even though every real step (tests, manual verification, man page, site build, deploy) already succeeded. This commit only ever touches three generated files (fish-config.md/.1, the component registry), so a rebase onto whatever landed is always mechanical -- retry push up to 3 times, rebasing onto origin/main between attempts. Ends on an explicit `test "$pushed" -eq 1` rather than trailing off the for loop, so a run that exhausts all three retries still fails loudly instead of reporting success. --- .github/workflows/ci.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7999e3..57840a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,7 +181,25 @@ jobs: git add docs/fish-config.md docs/fish-config.1 conf.d/__fish_config_op_registry.fish git diff --cached --quiet && echo "No changes to commit" && exit 0 git commit -m "chore(docs): regenerate manual, man page, and component registry" - git push + + # npm ci + astro build + the Cloudflare deploy above can take + # several minutes, so main can move (another PR merges) before + # this push lands -- a bare `git push` was seen rejected as + # non-fast-forward for exactly that reason (run 976). This + # commit only ever touches generated files, so a rebase onto + # whatever landed is always mechanical; retry it a few times + # against a live race instead of failing the whole job. + pushed=0 + for attempt in 1 2 3; do + if git push; then + pushed=1 + break + fi + echo "push rejected (attempt $attempt/3), rebasing onto origin/main..." >&2 + git fetch origin main + git rebase origin/main + done + test "$pushed" -eq 1 # Stand-in for the GitHub mirror so the commit gets a completed status # instead of the real jobs above sitting queued forever for a