Skip to content

ci: publish only when the commit is already on master - #396

Merged
plrthink merged 2 commits into
masterfrom
cursor/publish-only-from-master-da8d
Sep 28, 2026
Merged

plrthink merged 2 commits into
masterfrom
cursor/publish-only-from-master-da8d

Conversation

@plrthink

Copy link
Copy Markdown
Collaborator

Summary

There is no marketplace action that means “this tag is already on master.” npm publish in this repo follows the tag, which is why 9.5.2 shipped while #395 was still open.

This adds our own check as the first job in publish.yml. It fetches origin/master and refuses to continue unless HEAD is already on that branch. A tag on an open pull request fails before the interop job and before npm publish. Manual dispatch is covered by the same check.

7.x is unchanged. Its tags still run the workflow file on the 7.x commit.

After this merges, the release order is: merge the version bump, then tag that merge commit.

Test plan

  • jest __tests__/require-commit-on-master.test.js — accepts a commit on master, rejects a commit that exists only on a branch, accepts it again after a fast-forward merge
  • A future tag pushed from an unmerged branch fails the “Require commit on master” job
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 28, 2026 02:59
npm publish follows the tag, so an open release PR could ship before it
was merged. Fail the workflow first unless HEAD is contained in master.

Co-authored-by: Perry <plrthink@gmail.com>
The publish job now depends on both gates, so the old needs: zip-interop
assertion no longer matches the workflow.

Co-authored-by: Perry <plrthink@gmail.com>
@plrthink
plrthink merged commit d3ef4ee into master Sep 28, 2026
16 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.

2 participants