Skip to content

Commit 5fdae71

Browse files
cablateclaude
andauthored
fix: make release workflow resilient to version desync (#40)
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 <noreply@anthropic.com>
1 parent 56327cd commit 5fdae71

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ jobs:
3535
env:
3636
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
3737

38+
- name: Sync latest from main (pick up previous release commits)
39+
run: |
40+
git config user.name "github-actions[bot]"
41+
git config user.email "github-actions[bot]@users.noreply.github.com"
42+
git pull --rebase
43+
3844
- name: Bump version
3945
run: npm version patch --no-git-tag-version
4046

@@ -82,11 +88,10 @@ jobs:
8288
- name: Commit version bump & tag
8389
run: |
8490
VERSION=$(node -p "require('./package.json').version")
85-
git config user.name "github-actions[bot]"
86-
git config user.email "github-actions[bot]@users.noreply.github.com"
8791
git add package.json package-lock.json CHANGELOG.md server.json
8892
git commit -m "chore: release v${VERSION}"
8993
git tag "v${VERSION}"
94+
git pull --rebase
9095
git push
9196
git push --tags
9297

0 commit comments

Comments
 (0)