Skip to content

Commit e825409

Browse files
authored
ci(release): exit changeset pre mode before snapshot prerelease (#3665)
## Summary The prerelease (snapshot) path of the release workflow fails immediately whenever `main` carries an active `.changeset/pre.json` (i.e. during an in-progress RC cycle, like the current v4 RC): ``` 🦋 error Snapshot release is not allowed in pre mode 🦋 To resolve this exit the pre mode by running `changeset pre exit` ``` This blocks `chat-prerelease` snapshots from main even though the snapshots are unrelated to the RC cycle. Adds a conditional `changeset pre exit` step right before `Snapshot version` in the prerelease job. The job runs on a checkout with `persist-credentials: false`, so the `pre.json` deletion stays on the runner's working tree — main's persisted pre-mode state is untouched, and v4 RC publishes keep working normally. ## Test plan - [ ] Re-run the `🦋 Changesets Release` workflow with `type=prerelease`, `ref=main`, `prerelease_tag=chat-prerelease` and confirm it gets past the snapshot step and publishes. - [ ] Confirm `.changeset/pre.json` on `main` is unchanged after the run.
1 parent 2f261e5 commit e825409

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,13 @@ jobs:
302302
- name: Generate Prisma Client
303303
run: pnpm run generate
304304

305+
- name: Exit changeset pre mode (if active)
306+
run: |
307+
if [ -f .changeset/pre.json ]; then
308+
echo "Repo is in changeset pre mode; exiting so snapshot release can run"
309+
pnpm exec changeset pre exit
310+
fi
311+
305312
- name: Snapshot version
306313
run: pnpm exec changeset version --snapshot "${GITHUB_EVENT_INPUTS_PRERELEASE_TAG}"
307314
env:

0 commit comments

Comments
 (0)