fix(ci): install an npm new enough for trusted publishing - #21
Merged
Conversation
npm performs the OIDC exchange itself and only gained that support in 11.5.1; Node 22 bundles npm 10.x, so npm publish ran unauthenticated and failed with ENEEDAUTH while the plugin reported the exchange succeeding.
|
🎉 This PR is included in version 1.0.3 🎉 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.
The 1.0.2 release now gets all the way to the publish and fails there:
Cause
@semantic-release/npmdoes not publish with the OIDC token itself — it only confirms the exchange is possible, then deliberately writes no auth to.npmrcand letsnpm publishhandle it:npm gained trusted-publishing support in 11.5.1. The runner resolves
node-version: 22to 22.23.2, which bundles npm 10.x — sonpm publishruns with no credentials at all.Fix
Install npm
^11.5.1before the release step, and print the version so this is visible in the log.Note
The trusted publisher on npmjs.com is already correct. The registry only mints an exchange token for a matching repo + workflow, and the log shows:
So this is the last piece — no npmjs.com change needed.
Related: the stale
fix/release-disable-oidcbranch (off the 1.0.1 release commit) hit this same wall and worked around it by abandoning OIDC. This fixes it instead, keeping trusted publishing and the provenance attestation that comes with it. That branch can be deleted.