From ef4de3bc72911ad36796d79a778b915cd0d2203e Mon Sep 17 00:00:00 2001 From: Abhijoy Sarkar Date: Sun, 19 Apr 2026 04:48:27 +0530 Subject: [PATCH] fix(sync): unique branch per run to avoid stale-branch collisions Date-based branch name (auto/sync-api-types-YYYYMMDD) collides with itself if a same-day run failed and left the branch behind. Use ${{ github.run_id }} so every run gets its own branch. Discovered after the prior 'git identity' fix unblocked the workflow, which then died on 'failed to push' because the branch from the broken run still existed on the remote. --- .github/workflows/sync-from-api.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-from-api.yml b/.github/workflows/sync-from-api.yml index 317a965..20dc342 100644 --- a/.github/workflows/sync-from-api.yml +++ b/.github/workflows/sync-from-api.yml @@ -77,7 +77,9 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git config user.name "github-actions[bot]" - BRANCH="auto/sync-api-types-$(date +%Y%m%d)" + # Unique branch per run avoids collisions when the daily + # sync branch already exists from a prior failed run. + BRANCH="auto/sync-api-types-${{ github.run_id }}" git checkout -b "$BRANCH" git add promptguard/generated/ git commit -m "chore: sync generated types from API spec"