Skip to content

Fix the npm publish release workflow (trusted publishing + tag push)#417

Merged
grahamlangford merged 1 commit into
mainfrom
worktree-npm-trusted-publish-fix
Jul 10, 2026
Merged

Fix the npm publish release workflow (trusted publishing + tag push)#417
grahamlangford merged 1 commit into
mainfrom
worktree-npm-trusted-publish-fix

Conversation

@grahamlangford

@grahamlangford grahamlangford commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Publish workflow was failing in two places:

  1. npm publish404 PUT ... Not found. npmjs trusted publishing and the workflow's id-token: write permission 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 placeholder NODE_AUTH_TOKEN that setup-node writes when no token is supplied → 404.
  2. git push --follow-tags403 denied to github-actions[bot]. The workflow only granted contents: read, but pushing the version tag and running gh release create need contents: write.

Fix

  • Bump .nvmrc to 24.18.0 (Node 24 "Krypton" LTS, npm 11.16.0). The publish workflow reads .nvmrc, so npm publish now uses OIDC trusted publishing (with automatic provenance). Node 22 never ships npm >= 11.5.1, so a within-22 bump wouldn't work. CI reads package.json, so it's unaffected.
  • Change the workflow permission from contents: read to contents: write so 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

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>
@grahamlangford
grahamlangford merged commit 483e58a into main Jul 10, 2026
5 checks passed
@grahamlangford
grahamlangford deleted the worktree-npm-trusted-publish-fix branch July 10, 2026 21:59
@grahamlangford grahamlangford changed the title Bump .nvmrc to Node 24 for npm trusted publishing Fix the npm publish release workflow (trusted publishing + tag push) Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant