Skip to content

Release when a version tag is pushed - #112

Merged
nstepien merged 1 commit into
mainfrom
release-on-tag
Oct 17, 2026
Merged

nstepien merged 1 commit into
mainfrom
release-on-tag

Conversation

@nstepien

Copy link
Copy Markdown
Owner

The release workflow ran npm version itself but could only push the tag, as the default branch ruleset blocks its push to main, so the version commit never landed on main. Now npm version runs locally, and pushing the version commit and its tag runs the workflow.

How to release

On an up-to-date main:

npm version <patch|minor|major|x.y.z>
git push --atomic --follow-tags origin main

npm version commits the new version and creates an annotated vX.Y.Z tag. --follow-tags pushes that tag along with main, and --atomic makes the push all or nothing. As an admin, you bypass the default branch ruleset for the push to main. The same steps are documented at the top of release.yml.

Changes

  • The workflow runs on push of v* tags instead of workflow_dispatch.
  • The build job checks that the tagged commit is on main (replacing the github.ref guard) and that the tag matches package.json's version, before installing anything. Then it runs the same checks and build as before.
  • The release job no longer configures git, runs npm version, or pushes the tag. It publishes dist and creates the GitHub release for the existing tag with --verify-tag, so contents: write is now only used for the release.
  • AGENTS.md points to the workflow's header for the release steps.

The workflow file name is unchanged, so npm's trusted publisher config still matches.

Verification

  • With a local bare remote, I confirmed that npm version minor creates an annotated tag, and that git push --atomic --follow-tags origin main pushes both refs, or neither when the remote rejects main.
  • The ancestry check passes for v0.5.0's commit and fails for Full import/export handling, query variant modules, and raw TypeScript #68's head. The version check passes for v0.5.0 and fails for v0.5.1 on the current package.json.
  • zizmor reports nothing with the regular persona. actionlint only flags cache-mode, which it doesn't know yet.

Suggested follow-up

Now that the workflow no longer creates tags, enable Restrict creations in the Release tags ruleset. With the admin bypass, only admins can then create v* tags, which means only admins can start a release.

🤖 Generated with Claude Code

The release workflow ran `npm version` itself but could only push the
tag, as the default branch ruleset blocks its push to main, so the
version commit never landed on main. Now `npm version` runs locally,
and pushing main and the new tag together runs the workflow, which:

- checks that the tag is on main and matches the package version,
- checks, builds, and publishes the tagged commit as before,
- creates the GitHub release for the existing tag (`--verify-tag`).

The release job no longer pushes anything, so `contents: write` is only
needed for the GitHub release. The workflow's header documents the
release steps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: nstepien/ecij/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a013053e-fc02-404a-9af5-88c8ad1f8b19
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nstepien
nstepien merged commit eb113a3 into main Oct 17, 2026
9 checks passed
@nstepien
nstepien deleted the release-on-tag branch October 17, 2026 22:20
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