Skip to content

Publish via OIDC trusted publishing, with no token in the workflow#6

Merged
Acro merged 1 commit into
masterfrom
publish-via-oidc
Jul 24, 2026
Merged

Publish via OIDC trusted publishing, with no token in the workflow#6
Acro merged 1 commit into
masterfrom
publish-via-oidc

Conversation

@Acro

@Acro Acro commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Prep for cutting the 3.0.0 release. The package now has a trusted publisher configured on npmjs.com (Acro/simple-builderpublish.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_TOKEN from the publish step. setup-node's registry-url writes _authToken=${NODE_AUTH_TOKEN} into the runner's .npmrc; with no NPM_TOKEN secret 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:

  • the trusted publisher matches on workflow filename, so renaming publish.yml breaks publishing until npmjs.com is updated;
  • release events run the workflow from the tagged commit, so workflow changes must land on master before the tag is cut;
  • no token exists anywhere, and NODE_AUTH_TOKEN must not be added back.

No source or test changes — src/, test/ and the package surface are untouched.

🤖 Generated with Claude Code

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>
@Acro
Acro merged commit 3153427 into master Jul 24, 2026
8 checks passed
@Acro
Acro deleted the publish-via-oidc branch July 24, 2026 20:42
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