Skip to content

fix(ci): publish when the release PR merges, not when a changeset lands - #8

Merged
upupming merged 1 commit into
mainfrom
fix/publish-after-version-pr
Aug 25, 2026
Merged

upupming merged 1 commit into
mainfrom
fix/publish-after-version-pr

Conversation

@upupming

Copy link
Copy Markdown
Contributor

0.2.0 was published the moment #6 merged, while its release PR was still open:

version | Attempt to release | creating pull request
version | Publish packages   | 📦 @react-navigation/lynx@0.2.0 → registry.npmjs.org
version | Publish packages   | ✅ Published package @react-navigation/lynx@0.2.0

By the time that PR was merged, its own run had nothing left to do:

No changesets present or were removed by merging release PR.
There are no new packages that should be published

changesets/action runs changeset version in the working directory and pushes the result to the release branch. The publish step I added in #5 runs after it in the same job, so it reads a package.json that is already bumped. The release PR became decorative: a changeset landing on main was enough to ship.

Gating on the action's has-changesets output restores the intended order. It reads false exactly when there is nothing pending — either the release PR just merged, or the commit never had a changeset — and pnpm publish skips versions that already exist, so the second case is a no-op.

changesets/action runs `changeset version` in the working directory before it
pushes the release branch, so the publish step that follows it in the same job
sees a tree that is already bumped. 0.2.0 went out the moment #6 merged, while
its release PR was still open - and that PR's own run then had nothing left to
do. Gating on `has-changesets` puts the release back behind the merge.
@changeset-bot

changeset-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6f61002

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@upupming
upupming merged commit 218efca into main Aug 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant