ci(release): npm Trusted Publishing (OIDC), drop NPM_TOKEN#68
Merged
Conversation
The npm package now requires Trusted Publishing (tokens disallowed), so authenticate the release with GitHub OIDC instead of a long-lived token: - Remove NODE_AUTH_TOKEN / NPM_TOKEN from the publish step. The workflow already grants `id-token: write`, which is what OIDC needs. - Bump .nvmrc 22 -> 24: OIDC trusted publishing requires npm >= 11.5.1, and Node 24 ships npm >= 11.6 (Node 22 ships npm 10.x). release-it-pnpm disables release-it's built-in npm plugin and publishes via `pnpm publish`, so there is no `npm whoami` auth pre-check to break. After a successful release the NPM_TOKEN secret can be deleted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Switches the release workflow to npm Trusted Publishing (OIDC) now that the package has tokens disallowed.
Changes
release.yml: removedNODE_AUTH_TOKEN/NPM_TOKENfrom the publish step. The workflow already grantspermissions: id-token: write, which is all OIDC needs..nvmrc: 22 → 24. OIDC trusted publishing requires npm ≥ 11.5.1; Node 24 ships npm ≥ 11.6, while Node 22 ships npm 10.x.Why it's safe
release-it-pnpmdisables release-it's built-innpmplugin (disablePlugin()→['npm','version']), so there's nonpm whoamiauth pre-check to fail with tokens disallowed — publishing is done entirely bypnpm publish, which supports OIDC (pnpm#9812) on the native path withpnpm/action-setup@v6.Verified
ci + e2e run on Node 24 via
.nvmrc. Locally on Node 24: lint, 115 tests, build all pass.Note
The actual token-less publish can only be confirmed by triggering the manual
Release and Publishworkflow — pnpm 11's OIDC path is the one thing worth watching on the first run. After a successful release, theNPM_TOKENsecret can be deleted.🤖 Generated with Claude Code