Repository navigation
ci: publish via npm trusted publishing (OIDC), no stored token - #5
Merged
Merged
Conversation
Replaces token-based publishing. npm trusts this workflow file in this repo over OIDC, so each publish uses a short-lived credential and there is no long-lived token stored anywhere. The immediate reason: the automation token in ~/.npmrc had expired, which is why 2.1.0 nearly did not ship and why 2.0.4 was merged but never released at all. Granular tokens are the only kind npm issues now and they all carry a mandatory expiry, so that failure recurs on a timer. npm is also removing direct publishing with bypass-2FA tokens in January 2027, which makes the token path a dead end regardless. Releases now trigger on a v* tag. The workflow refuses to publish when the tag and package.json version disagree, runs the suite on macos-latest to match ci.yml, skips the dependency cache so the published artifact comes from a clean install, and pins npm to latest because OIDC support landed in npm 11.5.x. Provenance attestations are generated automatically for a public repo publishing a public package; no --provenance flag needed. Requires a one-time trusted-publisher configuration on npmjs.com, which needs an interactive 2FA challenge and so cannot be scripted. Claude-Session: https://claude.ai/code/session_01LMbjcZogpv9EbVnqovXpSX
kaufmanhenry
added a commit
that referenced
this pull request
Sep 29, 2026
No code changes. Cuts a release so the OIDC pipeline added in #5 is actually exercised, and so the package gets its first provenance attestation — 2.1.0 was published from a laptop with a token and carries none. Proving it now, while today's token still works as a fallback, rather than discovering a misconfiguration on some future release. npm does not validate a trusted-publisher config when you save it; the first publish is the only test. Claude-Session: https://claude.ai/code/session_01LMbjcZogpv9EbVnqovXpSX
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.
Publishing moves from a stored npm token to trusted publishing over OIDC.
Why
The automation token in
~/.npmrchad expired, which is why 2.1.0 nearly didn't ship — and why 2.0.4 was merged but never published at all. Granular tokens are the only kind npm issues now and every one carries a mandatory expiry, so that failure repeats on a timer.npm is also removing direct publishing with bypass-2FA tokens in January 2027, so the token path is a dead end either way.
With OIDC there is no stored credential: npm trusts
.github/workflows/publish.ymlin this repo, and each publish mints a short-lived one.How releases work now
Pushing the tag is the release.
Guards in the workflow:
package.jsonversion disagreemacos-latest, matchingci.yml— the package is macOS-only and a release is the wrong place to discover it doesn't pass on LinuxProvenance attestations are generated automatically (public repo, public package) — no
--provenanceflag required.Not done here: the npmjs.com side
This PR is inert until a trusted publisher is configured on npmjs.com. That requires an interactive 2FA challenge and can't be scripted. Settings → Trusted Publisher → GitHub Actions:
kaufmanhenrythingsctlpublish.ymlnpm publishTwo things that silently break it later: renaming
publish.yml(npm pins the filename; failsENEEDAUTH), and changingrepository.urlinpackage.json(must match this repo exactly). Both are called out in the README.Once a release succeeds this way, the remaining hardening is Settings → Publishing access → "Require two-factor authentication and disallow tokens", then revoking the token created today.
https://claude.ai/code/session_01LMbjcZogpv9EbVnqovXpSX