Skip to content

fix: npm publish via trusted publishing (OIDC), not a token - #65

Merged
willwade merged 1 commit into
mainfrom
fix/npm-trusted-publishing
Aug 29, 2026
Merged

fix: npm publish via trusted publishing (OIDC), not a token#65
willwade merged 1 commit into
mainfrom
fix/npm-trusted-publishing

Conversation

@willwade

Copy link
Copy Markdown
Collaborator

The npm leg of the v0.0.36/v0.1.1 releases failed with 404-on-PUT — the NPM_TOKEN secret has been dead since May (npm returns 404 rather than 401 for bad auth). npm has deprecated tokens in favour of trusted publishing, which the PyPI workflow in this repo already uses; this brings npm-publish.yml to the same mechanism.

  • id-token: write, no NODE_AUTH_TOKEN anywhere
  • node 24.x (npm ≥11.5.1 does the OIDC exchange automatically)
  • actions v4
  • workflow_dispatch + tag input, so v0.1.1's npm leg can be republished without cutting a new tag

One-time prerequisite (needs your npm login, I can't do it): npmjs.com → worldalphabets package → Settings → Trusted Publisher → Repository AACTools/WorldAlphabets, workflow npm-publish.yml, default environment. Then dispatch this workflow with v0.1.1.

DCO signed.

The token-based publish failed on the v0.0.36/v0.1.1 releases with
404-on-PUT — the NPM_TOKEN secret has been dead since May (npm returns
404 rather than 401 for bad auth to avoid leaking package existence).
npm has deprecated registry tokens in favour of trusted publishing,
which the PyPI workflow here already uses.

- permissions: id-token: write; no NODE_AUTH_TOKEN anywhere
- node 24.x (npm 11.5.1+ handles the OIDC exchange automatically)
- checkout@4/setup-node@4 (v3 actions are sunset)
- workflow_dispatch with a tag input so a release whose npm leg failed
  (like v0.1.1) can be republished without cutting a new tag

Requires the matching trusted-publisher registration on npmjs.com for
worldalphabets: AACTools/WorldAlphabets, workflow npm-publish.yml.

Signed-off-by: will wade <willwade@gmail.com>
@willwade
willwade merged commit dfec80e into main Aug 29, 2026
5 checks passed
@willwade
willwade deleted the fix/npm-trusted-publishing branch August 29, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant