From 39474d4ec5fc33997136bbdfcd1c78730f6ae8fd Mon Sep 17 00:00:00 2001 From: CabLate Date: Sat, 14 Mar 2026 14:34:59 +0800 Subject: [PATCH] fix: make release workflow resilient to version desync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add git pull --rebase at two points: 1. Before version bump — picks up previous release's version commit 2. Before git push — handles any commits pushed during the job This prevents the scenario where a queued release job bumps from a stale version and collides with an already-published npm version. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e6bd75..0c5e25f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,6 +35,12 @@ jobs: env: GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }} + - name: Sync latest from main (pick up previous release commits) + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git pull --rebase + - name: Bump version run: npm version patch --no-git-tag-version @@ -82,11 +88,10 @@ jobs: - name: Commit version bump & tag run: | VERSION=$(node -p "require('./package.json').version") - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" git add package.json package-lock.json CHANGELOG.md server.json git commit -m "chore: release v${VERSION}" git tag "v${VERSION}" + git pull --rebase git push git push --tags