Fix the npm publish release workflow (trusted publishing + tag push)#417
Merged
Conversation
Node 22 ships npm 10.9.x, but OIDC trusted publishing requires npm >= 11.5.1. Node 24.18.0 bundles npm 11.16.0, so the publish workflow (which reads .nvmrc) can use OIDC instead of falling back to the placeholder NODE_AUTH_TOKEN, which caused the 404 on publish. 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.
Problem
The Publish workflow was failing in two places:
npm publish→404 PUT ... Not found. npmjs trusted publishing and the workflow'sid-token: writepermission were correct, but Node 22.18.0 bundles npm 10.9.3, and OIDC trusted publishing requires npm >= 11.5.1. npm fell back to token auth using the placeholderNODE_AUTH_TOKENthatsetup-nodewrites when no token is supplied → 404.git push --follow-tags→403denied to github-actions[bot]. The workflow only grantedcontents: read, but pushing the version tag and runninggh release createneedcontents: write.Fix
.nvmrcto24.18.0(Node 24 "Krypton" LTS, npm 11.16.0). The publish workflow reads.nvmrc, sonpm publishnow uses OIDC trusted publishing (with automatic provenance). Node 22 never ships npm >= 11.5.1, so a within-22 bump wouldn't work. CI readspackage.json, so it's unaffected.contents: readtocontents: writeso the tag push and release creation succeed.Both failures were observed in real dispatch runs; v0.36.0 published successfully once fix (1) was in place, then failed at the tag push.
🤖 Generated with Claude Code