fix: accept setup-node placeholder NODE_AUTH_TOKEN and npmrc template#8
Merged
TheCryptoDonkey merged 1 commit intomainfrom May 3, 2026
Merged
Conversation
actions/setup-node@v6 exports NODE_AUTH_TOKEN=XXXXX-XXXXX-XXXXX-XXXXX
to GITHUB_ENV and writes _authToken=${NODE_AUTH_TOKEN} to the generated
.npmrc whenever registry-url is set without a real token. Both are
literal placeholders that npm 11.5+ ignores during OIDC exchange, but
the strict null/auth-material checks in publish-npm trip on them
before npm ever runs.
Whitelist the exact placeholder values. Anything else still fails
closed.
See actions/setup-node src/authutil.ts.
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.
Summary
actions/setup-node@v6writesNODE_AUTH_TOKEN=XXXXX-XXXXX-XXXXX-XXXXXtoGITHUB_ENVand_authToken=${NODE_AUTH_TOKEN}into the generated.npmrcwheneverregistry-urlis set without a real token. Seeactions/setup-nodesrc/authutil.ts.NODE_AUTH_TOKENand the_authToken=regex inpublish-npm.shwere both tripping on the placeholders before npm ever ran. Every consumer using anvil's reusablerelease.ymlwas hitting this — visible in failed runs across forgesworn repos where v0.2.x / v0.3.x publishes died onNODE_AUTH_TOKEN is setdespite no real token being configured.Why this matters
Without this fix, every anvil-published forgesworn package has been silently failing OIDC publish since the strict guard landed in v0.10.0. Manual republishes have been masking the regression.
Test plan
shellcheck -x steps/publish-npm.shcleanbats test/*.bats— 147/147 pass, including four new cases:NODE_AUTH_TOKENXXXXX-XXXXX-XXXXX-XXXXXplaceholder_authToken=secretin.npmrc(existing test, still passes)_authToken=${NODE_AUTH_TOKEN}template in.npmrcforgesworn/signet-verifyrelease workflow onv0.3.1and confirm OIDC publish succeeds (Trusted Publisher must also be configured at npmjs.com — separate admin step).