Skip to content

Commit 3045ecb

Browse files
wrn14897claude
andcommitted
fix: re-checkout before snapshot publish to prevent version collision
The changesets action consumes changeset files when creating the Release PR, so the subsequent `changeset version --snapshot next` finds nothing and publishes full release versions to the `next` tag. This causes the actual release publish to skip those versions since they already exist on npm. Adding a fresh checkout + install before the snapshot step restores the changeset files so proper snapshot versions are generated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1a5b0ed commit 3045ecb

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ jobs:
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
NPM_CONFIG_PROVENANCE: true
40+
# Re-checkout to restore changeset files consumed by the changesets action above.
41+
# Without this, `changeset version --snapshot next` finds no changesets and
42+
# publishes full release versions to the `next` tag instead of snapshots.
43+
- name: Restore checkout for snapshot
44+
if: steps.changesets.outputs.published != 'true' && steps.changesets.outputs.hasChangesets == 'true'
45+
uses: actions/checkout@v4
46+
- name: Install dependencies for snapshot
47+
if: steps.changesets.outputs.published != 'true' && steps.changesets.outputs.hasChangesets == 'true'
48+
run: yarn
4049
- name: Publish snapshot to next tag
4150
if: steps.changesets.outputs.published != 'true' && steps.changesets.outputs.hasChangesets == 'true'
4251
run: yarn run release:next

0 commit comments

Comments
 (0)