Skip to content

ci: publish via OIDC, so no npm token has to exist - #3

Merged
catomean merged 1 commit into
mainfrom
ci/trusted-publishing
Aug 16, 2026
Merged

ci: publish via OIDC, so no npm token has to exist#3
catomean merged 1 commit into
mainfrom
ci/trusted-publishing

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

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

Both from the npm docs:

was now
npm version Node 22 → bundles npm 10.x; OIDC needs >= 11.5.1 Node 24, which ships npm 11
auth NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} — an empty string with no secret set no token at all; id-token: write does the work

Provenance 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's repository.url already matches the GitHub repo, which OIDC requires. Note npm does not validate a trusted-publisher config when saved — a typo surfaces only as ENEEDAUTH on the first publish.

🤖 Generated with Claude Code

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>
@catomean
catomean merged commit 351612d into main Aug 16, 2026
1 check passed
@catomean
catomean deleted the ci/trusted-publishing branch August 16, 2026 13:59
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