ci: publish via OIDC, so no npm token has to exist - #3
Merged
Conversation
The publish workflow added yesterday needed an NPM_TOKEN secret. Trusted
publishing removes that requirement entirely: the workflow exchanges a
short-lived, workflow-scoped OIDC credential with npm at publish time, so
nothing long-lived is stored and there is no secret to leak or rotate.
Two things this workflow would have failed on, from the npm docs:
- Node 22 bundles npm 10.x, but trusted publishing requires npm >= 11.5.1.
Node 24 ships npm 11, so the runtime is bumped rather than adding a
separate npm upgrade step.
- `NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}` passed an empty string with no
secret set. The documented OIDC example sets no token at all — the
`id-token: write` permission already present is what does the work.
Provenance stops needing the flag: npm generates attestations automatically
for a public package published from a public repo via OIDC.
Matches the identical change in ai-forms, so the two libraries keep releasing
the same way.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 16, 2026
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 publish workflow added yesterday needed an
NPM_TOKENsecret. Trusted publishing removes that requirement entirely — the workflow exchanges a short-lived, workflow-scoped OIDC credential with npm at publish time, so nothing long-lived is stored and there is no secret to leak or rotate.Two things this workflow would have failed on
Both from the npm docs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}— an empty string with no secret setid-token: writedoes the workProvenance stops needing a flag — npm generates attestations automatically for a public package published from a public repo via OIDC.
Matches the identical change in
ai-forms, so the two libraries keep releasing the same way.package.json'srepository.urlalready matches the GitHub repo, which OIDC requires. Note npm does not validate a trusted-publisher config when saved — a typo surfaces only asENEEDAUTHon the first publish.🤖 Generated with Claude Code