From f90309170f5d5feed92a82a6039a77ad6654ac01 Mon Sep 17 00:00:00 2001 From: Kacper Wojciechowski <39823706+jog1t@users.noreply.github.com> Date: Wed, 19 Aug 2026 00:50:51 +0200 Subject: [PATCH 1/2] fix(sync-docs): unfreeze the docs sync push and PR creation --- .github/actions/sync-docs/action.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/actions/sync-docs/action.yml b/.github/actions/sync-docs/action.yml index 4d940e4..db49d5f 100644 --- a/.github/actions/sync-docs/action.yml +++ b/.github/actions/sync-docs/action.yml @@ -100,9 +100,16 @@ runs: git checkout -B "$branch" git add -A "vendor/$product" git commit -m "docs($product): sync from ${GITHUB_REPOSITORY}@${short}" - git push --force-with-lease origin "$branch" + # The branch is rebuilt from the product repo every run, so its previous + # contents are never a base to preserve. A lease would compare against a + # remote-tracking ref this shallow checkout never fetched, which rejects + # every run after the branch first exists. + git push --force origin "$branch" - if ! gh pr view "$branch" --json number >/dev/null 2>&1; then + # Match only an open PR. `gh pr view ` also resolves closed and + # merged ones, so once the first sync PR merges the create is skipped + # forever and each run pushes a branch nobody reviews. + if [ -z "$(gh pr list --head "$branch" --state open --json number --jq '.[0].number // empty')" ]; then # Build the body with printf rather than a literal newline in the YAML. # A continuation line starting at column 1 would close this block # scalar, and indenting it instead would put four or more leading From 414079ce9c67be5b1f6f28dfe03d6788461862e3 Mon Sep 17 00:00:00 2001 From: Kacper Wojciechowski <39823706+jog1t@users.noreply.github.com> Date: Wed, 19 Aug 2026 00:54:41 +0200 Subject: [PATCH 2/2] fix(ci): exempt the sync branch from the vendor guard --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38e9f6c..aa9c959 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,12 +53,20 @@ jobs: BASE: ${{ github.event.pull_request.base.sha }} HEAD: ${{ github.event.pull_request.head.sha }} AUTHOR: ${{ github.event.pull_request.user.login }} + HEAD_REF: ${{ github.event.pull_request.head.ref }} run: | set -euo pipefail case "$AUTHOR" in *"[bot]"|rivet-docs-sync*) echo "sync bot; skipping"; exit 0 ;; esac + # The sync force-pushes docs-sync/* from scratch every run, so nothing + # written there by hand survives regardless. Exempt the branch as well + # as the bot, or a sync PR reopened by a human fails this guard. + case "$HEAD_REF" in + docs-sync/*) echo "sync branch; skipping"; exit 0 ;; + esac + changed=$(git diff --name-only "$BASE" "$HEAD" -- vendor/ || true) if [ -n "$changed" ]; then echo "::error::vendor/ is generated by the sync-docs action. Edit the docs in the product repo instead."