Publish via OIDC trusted publishing, with no token in the workflow#6
Merged
Conversation
The package is configured on npmjs.com with a trusted publisher pointing at
this repo and publish.yml, and its publishing access is set to disallow
tokens — so the OIDC exchange is now the only route to npm.
Drop NODE_AUTH_TOKEN from the publish step. setup-node's registry-url writes
`_authToken=${NODE_AUTH_TOKEN}` into .npmrc, and with no NPM_TOKEN secret
that expands to an empty credential; npm can read that as auth-already-
configured and skip the OIDC exchange, failing with a 401 after all five
gates have already run. npm's own trusted-publishing example omits it.
Record the constraints this puts on the release path in AGENTS.md — notably
that the trusted publisher matches on workflow *filename*, so renaming this
file silently breaks publishing, and that `release` events run the workflow
from the tagged commit, so workflow changes must land before the tag.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
Prep for cutting the 3.0.0 release. The package now has a trusted publisher configured on npmjs.com (
Acro/simple-builder→publish.yml), and its publishing access is set to "Require two-factor authentication and disallow tokens" — so the OIDC exchange is the only route to npm; an automation token would be rejected.The fix: drop
NODE_AUTH_TOKENfrom the publish step.setup-node'sregistry-urlwrites_authToken=${NODE_AUTH_TOKEN}into the runner's.npmrc; with noNPM_TOKENsecret that expands to an empty credential, which npm can read as "auth already configured" and skip the OIDC exchange — a 401 after all five gates have already run. npm's own trusted-publishing example omits it.Also records the resulting constraints in
AGENTS.md, since they are not discoverable from the repo:publish.ymlbreaks publishing until npmjs.com is updated;releaseevents run the workflow from the tagged commit, so workflow changes must land onmasterbefore the tag is cut;NODE_AUTH_TOKENmust not be added back.No source or test changes —
src/,test/and the package surface are untouched.🤖 Generated with Claude Code