ci(sdk): drop registry-url so npm actually uses OIDC to publish - #35
Conversation
The first real publish (run 30397586602) passed every gate and then failed: npm error code E404 npm error 404 Not Found - PUT https://registry.npmjs.org/@bytesbrains%2fmaktub-sdk Nothing was published; 0.1.0-dev.4 is untouched and reusable. The cause was not the trusted-publisher config. `registry-url` makes setup-node write an .npmrc containing //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} and export NODE_AUTH_TOKEN as the literal placeholder XXXXX-XXXXX-XXXXX-XXXXX when no token is supplied. npm saw a configured credential, used it instead of attempting the OIDC exchange, and the registry rejected the garbage token. npm reports E404 rather than E401 so it does not leak which private packages exist, which makes a shadowed credential read like a misconfigured publisher and sends you looking in the wrong place. Confirmed on a runner rather than assumed: with registry-url absent, ACTIONS_ID_TOKEN_REQUEST_URL is set, NODE_AUTH_TOKEN is unset and no user npmrc is written. That also settles a red herring worth recording — GitHub does NOT list Id-token in the "GITHUB_TOKEN Permissions" log group even when it is granted, so that group cannot be used to check whether OIDC is available. The env var can. Dropping registry-url leaves npm on its default registry, which is the same host, and lets it authenticate via OIDC. Adds a gate that names both silent failure modes up front — no OIDC endpoint, or an _authToken configured anywhere npm reads — so this class of break can never again surface as an opaque E404 after the artifact has already been built. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
🤖 wrokin code reviewSummary: Removes No high‑signal issues (bug/security/correctness) identified in this diff. Model: deepseek/deepseek-v4-pro · your key, your model (BYOK) |
🤖 wrokin security auditNo security-relevant findings in this diff. The changes remove an incorrect Model: deepseek/deepseek-v4-pro · your key, your model (BYOK) |
🛡️ wrokin security hunterNo vulnerabilities were proven in this pull request — the hunter found nothing it could exploit and prove by execution. Advisory only — this check never blocks your PR. |
Problem
The first real publish (run 30397586602) passed every gate, built the correct tarball, and then failed at the publish step:
Nothing was published — the registry still holds three versions and
0.1.0-dev.4is untouched and reusable.The trusted-publisher config was not at fault.
registry-urlmakessetup-nodewrite an.npmrccontaining//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}and exportNODE_AUTH_TOKENas the literal placeholderXXXXX-XXXXX-XXXXX-XXXXXwhen no token is supplied. npm saw a configured credential, used it instead of attempting the OIDC exchange, and the registry rejected the garbage token.npm returns
E404rather thanE401so it doesn't leak which private packages exist — which is why a shadowed credential reads like a misconfigured publisher and sends you looking in the wrong place.Change summary
registry-urlfromsetup-node, with a comment explaining why it must stay removed so nobody "fixes" it back. npm falls back to its default registry — the same host — and authenticates via OIDC._authTokenconfigured in any npmrc npm reads. This class of break should never again surface as an opaqueE404after the artifact has been built.Tests
Diagnosed on a real runner rather than assumed. A throwaway branch printed the runner's actual state, and with
registry-urlabsent:That also settles a red herring worth recording: GitHub does not list
Id-tokenin the "GITHUB_TOKEN Permissions" log group even when it is granted. That group showed onlyContents: read/Metadata: readon both runs, which initially looked like the permission had been dropped. It hadn't — the env var proves OIDC was available all along. The new gate checks the env var, not the log group.YAML re-validated; 13 steps, permissions unchanged (
contents: read,id-token: write).Authentication is still only genuinely exercised on a real publish, so the proof is the next non-dry run.
Risk
Low. Confined to the publish workflow, which is inert until dispatched. The failure mode being fixed leaves nothing behind — the previous attempt wrote nothing to the registry.
Backwards-compat
None affected. No source file, published artifact, or other workflow is touched.
Privacy copy
No user-facing privacy copy.
🤖 Generated with Claude Code