fix(release): pr-based release flow so version bumps reach main#30
Merged
Conversation
added 2 commits
July 18, 2026 19:50
The Release workflow ran 'release-it --ci' which bumps the version, commits, tags, publishes to npm, and creates the GitHub release, but its 'git push' was silently rejected by main's branch-protection rules (PR-only pushes, 12 required status checks, CodeQL scan). release-it swallowed the error and tagged the step green, leaving an orphan tag and orphan GitHub release: run 29652144213 published v0.0.5 to npm and tagged v0.0.5 on GitHub while main stayed at 0.0.4. Replace release.yml with two workflows that respect branch protection: - release-pr.yml: bumps the version with the remote-touching steps disabled (--no-git.push, --no-npm.publish, --no-github.release), pushes the release commit to release/vX.Y.Z, and opens a PR with auto-merge + squash. workflow exits without waiting. - release-publish.yml: triggered by merged release PRs. retags the squash-merged commit (releasing the stale local tag from release-it and force-updating the remote tag), publishes to npm via OIDC trusted publishing, and creates the GitHub release. Also adds an 'increment' workflow_dispatch input on release-pr.yml so the maintainer can pass --increment=minor to skip past the prematurely-published v0.0.5 on the first release after this lands. Orphan v0.0.5 tag and the v0.0.5 GitHub release were cleaned up during the change; v0.0.5 on npm stays as-is.
Both actions released v7.0.0 since the previous commit: - actions/checkout v7.0.0 (2026-06-18) - actions/setup-node v7.0.0 (2026-07-14) setup-node v7 includes a fix to stop exporting a dummy NODE_AUTH_TOKEN, which is relevant to the publish step in release-publish.yml. v7 is already used by other workflows in this repo (commitlint, docs, security) so there is no version-drift risk to introduce.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Release workflow's
release-it --ciinvocation was silently failing on thegit pushstep becausemain's branch-protection rules require PRs, status checks, and a CodeQL scan. release-it swallowed the push error and reported ✔, leaving an orphan tag and an orphan GitHub Release: run 29652144213 publishedv0.0.5to npm and tagged it on GitHub whilemainstayed at0.0.4.What's in this PR
.github/workflows/release.yml(the broken workflow)..github/workflows/release-pr.yml(Phase 1): bumps the version with the remote-touching steps disabled, pushes the release commit torelease/vX.Y.Z, opens a PR, enables--auto --squashmerge. Workflow exits without waiting..github/workflows/release-publish.yml(Phase 2): triggered when a release PR is squash-merged intomain. Retags the squash-merged commit (handles the stale local tag from release-it + force-updates any existing remote tag), publishes to npm via OIDC trusted publishing, and creates the GitHub Release with--generate-notes.v0.0.5tag and thev0.0.5GitHub Release were removed during this change (npmv0.0.5stays as-is since it was already published).New
release-pr.ymlinputsincrement(defaultpatch): passminor(ormajor) the first time you release after this lands to skip pastv0.0.5on npm. Defaults topatchfor normal usage.Test plan
release-pr.yml, verify arelease/v*branch and PR with thereleaselabel exist and auto-merge is enabled. Close the PR without merging; confirmrelease-publish.ymldoes not trigger.increment=minorfor the first run), approve the PR (self-approval is allowed), wait for squash-merge. Verify:mainhas the squash-merged version-bump commit.release-publish.ymlruns onpull_request: closed(merged).v*retargets to the merge commit and is pushed.v*exists with auto-generated notes.release-publish.yml; confirm the delete-and-retag pattern handles it.Assumptions
mainstays as is (1 squash-merge approval, 12 status checks, CodeQL scan).allow_auto_mergeandallow_squash_mergealready true on the repo.productionenvironment.