fix(release): switch npm publish to OIDC trusted publishing#409
Merged
fix(release): switch npm publish to OIDC trusted publishing#409
Conversation
Switch the release workflow to npm's OIDC trusted publisher flow so publish credentials are minted per-run instead of a long-lived NPM_TOKEN secret. Adds the id-token: write permission, makes the contents/issues/pull-requests permissions explicit for the semantic-release git and github plugins, and upgrades npm to a version that supports OIDC publishing. Requires a Trusted Publisher entry for this workflow to be configured on npmjs.com before the next release runs. Refs: https://docs.npmjs.com/trusted-publishers
v13 added support for npm's OIDC trusted publisher flow — earlier versions still required NPM_TOKEN to be set even when the npm CLI itself would have used OIDC. Pairs with the previous commit that switched the release workflow over to OIDC. Note: v13 raises the engines requirement to Node ^22.14.0 || >=24.10.0, which is fine for the release job (uses Node *) but stricter than other tooling in the repo.
semantic-release v25 bundles @semantic-release/npm ^13.1.1, which matches our direct devDep and removes the duplicate v12 nested copy that v24 was carrying. No behavior change beyond cleaning up the plugin tree so the OIDC-capable npm plugin is the only one resolved. Engines for v25 are Node ^22.14.0 || >=24.10.0 (same as @semantic-release/npm v13).
Contributor
|
🎉 This PR is included in version 4.0.25 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
NPM_TOKENsecret.id-token: writeplus the explicitcontents/issues/pull-requestspermissions semantic-release's git/github plugins need.@semantic-release/npm^12.0.2→^13.1.5(first version that skips theNPM_TOKENprecheck under OIDC).semantic-release^24.0.0→^25.0.3so the bundled@semantic-release/npmmatches our direct devDep — removes a duplicate v12 copy that v24 was carrying. Brings@semantic-release/githubalong to v12 transitively.Required follow-up before merging
Configure a Trusted Publisher for
net-keepaliveon npmjs.com:hertzg/node-net-keepaliverelease.yamlUntil that's set up registry-side, the next release will fail at
npm publish. Once it works, theNPM_TOKENrepo secret can be deleted.Notes
semantic-release@25and@semantic-release/npm@13both raise engines to Node^22.14.0 || >=24.10.0. The release job usesnode-version: '*'so it's fine, but anyone runningnpm installlocally on older Node will hit engine warnings.@actions/core(+ transitives) for the OIDC token exchange, and the v24→v25 + v12→v13 churn re-resolved a lot of transitives.Plugin tree after the bumps
Test plan
NPM_TOKENused)NPM_TOKENrepo secret once a successful OIDC release lands