Skip to content

ci: stop setup-node writing the empty auth token that broke OIDC - #311

Merged
ralyodio merged 1 commit into
mainfrom
ci/fix-oidc-authtoken-line
Aug 6, 2026
Merged

ci: stop setup-node writing the empty auth token that broke OIDC#311
ralyodio merged 1 commit into
mainfrom
ci/fix-oidc-authtoken-line

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The v0.24.3 failure was this file, not npmjs.com

I read the E404 as a missing trusted publisher. It wasn't.

registry-url makes actions/setup-node write

//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}

into an .npmrc. That is correct for token auth and quietly fatal under trusted publishing: with no NODE_AUTH_TOKEN the line resolves to an empty token, npm believes it already has credentials, and never attempts the OIDC exchange at all. The registry answers the unauthenticated PUT with E404 — an error naming neither OIDC nor trusted publishing.

The evidence was in the logs the whole time: the v0.24.1 token run logged Signed provenance statement… before its E422, while the v0.24.3 OIDC run has no such line. No exchange was ever attempted.

Known issue: actions/setup-node#1551. npm tracks the misleading diagnostics in npm/cli#9088.

Changes

  • drop registry-url — no .npmrc is written, and npm defaults to registry.npmjs.org, which is where we publish
  • node 24 instead of 22 — bundles npm 11, and has been reported to settle OIDC handshakes that 22 did not. The npm ≥ 11.5.1 floor check stays, so this doesn't depend on what a runner image ships
  • --provenance restored — npm documents it as automatic under trusted publishing, but reports disagree; asking explicitly cannot give a weaker result, and it's what v0.24.2 published with
  • the header now separates the two causes of that E404 rather than asserting the wrong one

Verification

  • YAML parses; registry-url confirmed absent; zero secrets. references
  • full suite on node 24 (the new CI version): 1087 passed, 0 failed

Main is already at 0.24.3 and unpublished, so a plain dispatch tests this for real — no new release needed. If it still fails, the registration genuinely is missing and NPM_TOKEN (still set, and proven by v0.24.2) is one revert away.

🤖 Generated with Claude Code

The v0.24.3 publish failed with E404 and I read it as a missing trusted
publisher on npmjs.com. It was this file.

`registry-url` makes setup-node write

  //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}

into an .npmrc. That is right for token auth and quietly fatal under trusted
publishing: with no NODE_AUTH_TOKEN the line resolves to an empty token, npm
believes it already has credentials, and never attempts the OIDC exchange. The
registry answers the unauthenticated PUT with E404 — an error naming neither
OIDC nor trusted publishing, which is what sent me looking at the registry
config rather than at the workflow. actions/setup-node#1551, and npm/cli#9088
tracks the misleading diagnostics.

Dropping registry-url writes no .npmrc, and npm defaults to
registry.npmjs.org, which is where we publish.

Also:

- node 24 rather than 22, which bundles npm 11 and has been reported to settle
  OIDC handshakes that 22 did not. The npm floor check stays, so this does not
  depend on what a runner image ships.
- `--provenance` back on the publish. npm documents it as automatic under
  trusted publishing but reports disagree; asking explicitly cannot give a
  weaker result, and it is what v0.24.2 published with.
- the header now separates the two causes of that E404 instead of asserting the
  wrong one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

92 finding(s)

HIGH/CRITICAL: 50 | MEDIUM: 42

Severity Rule Location
HIGH manifest-typosquat apps/pwa/package.json:19
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
HIGH secret-generic-credential apps/pwa/test/apikey-bearer-scheme.test.mjs:30
HIGH secret-generic-credential apps/pwa/test/apikey-mask.test.mjs:38
HIGH secret-generic-credential apps/pwa/test/apikey-reveal.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/approvals-context.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/approvals-credits.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/approvals-notify.test.mjs:26
HIGH secret-generic-credential apps/pwa/test/approvals-resolve-race.test.mjs:20
HIGH secret-generic-credential apps/pwa/test/auth-form-email.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/auth-form-email.test.mjs:33
HIGH secret-generic-credential apps/pwa/test/auth-page-error.test.mjs:36
HIGH secret-generic-credential apps/pwa/test/cli-device-token.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/cli-pages-balance.test.mjs:32
HIGH secret-generic-credential apps/pwa/test/cli-token.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/credits-pack.test.mjs:51
HIGH secret-generic-credential apps/pwa/test/credits-webhook-event-match.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/credits-webhook.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/csrf-input-escaping.test.mjs:31
HIGH secret-generic-credential apps/pwa/test/csrf-input-escaping.test.mjs:101
HIGH secret-generic-credential apps/pwa/test/logout-csrf.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/moshpit-api-key.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-bulk-claim.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-claim-full-name.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/moshpit-crawlable.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-ending-page.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-pins.test.mjs:22
HIGH secret-generic-credential apps/pwa/test/moshpit-pit-page.test.mjs:33
HIGH secret-generic-credential apps/pwa/test/moshpit-records-page.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-records.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-registry.test.mjs:20
HIGH secret-generic-credential apps/pwa/test/moshpit-related-endings.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-sales.test.mjs:16
HIGH secret-generic-credential apps/pwa/test/moshpit-search.test.mjs:74
HIGH secret-generic-credential apps/pwa/test/moshpit-terms.test.mjs:19
HIGH secret-generic-credential apps/pwa/test/moshpit-tlds-pagination.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/passkey-register-duplicate.test.mjs:38
HIGH secret-generic-credential apps/pwa/test/require-auth-next.test.mjs:31
HIGH secret-generic-credential apps/pwa/test/require-auth-next.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/sessions-output-seq.test.mjs:30
HIGH secret-generic-credential apps/pwa/test/sessions-paste.test.mjs:24
HIGH secret-generic-credential apps/pwa/test/sessions-stream-replay.test.mjs:34
HIGH secret-generic-credential apps/pwa/test/sessions.test.mjs:24
HIGH secret-generic-credential apps/pwa/test/signature.test.mjs:6
HIGH secret-generic-credential test/auth.test.mjs:13
HIGH secret-generic-credential test/auth.test.mjs:63
HIGH secret-generic-credential test/console-cookie-malformed.test.mjs:15
HIGH secret-generic-credential test/console.test.mjs:12
HIGH secret-generic-credential test/mirror.test.mjs:37
HIGH secret-generic-credential test/mirror.test.mjs:77

…and 42 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 7597d40 into main Aug 6, 2026
4 checks passed
@ralyodio
ralyodio deleted the ci/fix-oidc-authtoken-line branch August 6, 2026 05:42
@ralyodio ralyodio mentioned this pull request Aug 6, 2026
ralyodio added a commit that referenced this pull request Aug 6, 2026
Bump to v0.25.0, releasing machine-readable account status via moshcode whoami --json (#302), plus the bin path cleanup (#313) and publish workflow changes (#311, #312).
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