From ec222c508b2071e313a2bd6b3350c05c16b31bf6 Mon Sep 17 00:00:00 2001 From: Daniel Naab Date: Fri, 1 May 2026 16:04:17 -0500 Subject: [PATCH] ci(refresh-catalog): fetch existing branch before force-with-lease When attempt 1 of a scheduled run pushes the branch and a later attempt re-runs the job, actions/checkout only fetches main. Without a remote-tracking ref for the catalog/refresh-* branch, git push --force-with-lease aborts with "stale info" and the workflow can never succeed on retry. Explicitly fetch the branch (best-effort, since it may not yet exist on first runs) so the lease has something to compare. --- .github/workflows/refresh-catalog.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/refresh-catalog.yml b/.github/workflows/refresh-catalog.yml index d8fb0e5..010ff84 100644 --- a/.github/workflows/refresh-catalog.yml +++ b/.github/workflows/refresh-catalog.yml @@ -39,6 +39,8 @@ jobs: BRANCH="catalog/refresh-$DATE" git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' + # Ensure remote-tracking ref exists so --force-with-lease works on retries. + git fetch origin "+refs/heads/$BRANCH:refs/remotes/origin/$BRANCH" || true git checkout -B "$BRANCH" git add data/repos.json git commit -m "chore(catalog): refresh snapshot $DATE"