fix: npm publish via trusted publishing (OIDC), not a token - #65
Merged
Conversation
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>
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 npm leg of the v0.0.36/v0.1.1 releases failed with 404-on-PUT — the
NPM_TOKENsecret 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, noNODE_AUTH_TOKENanywhereworkflow_dispatch+ tag input, so v0.1.1's npm leg can be republished without cutting a new tagOne-time prerequisite (needs your npm login, I can't do it): npmjs.com →
worldalphabetspackage → Settings → Trusted Publisher → RepositoryAACTools/WorldAlphabets, workflownpm-publish.yml, default environment. Then dispatch this workflow withv0.1.1.DCO signed.