Skip to content

chore(ci): temporary npm OIDC audience diagnostic - #108

Merged
Farenheith merged 1 commit into
masterfrom
chore/diagnose-npm-oidc
Nov 19, 2026
Merged

Farenheith merged 1 commit into
masterfrom
chore/diagnose-npm-oidc

Conversation

@Farenheith

Copy link
Copy Markdown
Member

Trusted Publisher is configured and it still fails, so the JWT itself is the suspect. PR #101 changed the mint URL from ?audience= to &audience=. GitHub's docs use & (their URL carries a query string); if this runner's ACTIONS_ID_TOKEN_REQUEST_URL has none, the audience param is swallowed into the path → JWT gets the default https://github.com/… audience → npm registry refuses it. release-it's isAuthenticated() runs npm whoami and only tolerates E401/E404 — other registry errors surface as exactly Not authenticated with npm.\n\nThe added step prints, for both URL forms: the decoded JWT claims (iss/aud/sub/nbf/exp only — token never printed), the registry /-/whoami HTTP status + body, and npm whoami verbatim.\n\nTo use: merge, then dispatch publish.yaml with dry_run=true. The run will still go red at lazy-structures (that's the bug under test) — paste/point me at the 'Diagnose npm OIDC audience' step and the real fix drops the guesswork.

'Not authenticated with npm' survives the Trusted Publisher setup, so the
suspect is the token itself: #101 changed the mint URL from ?audience= to
&audience=. If ACTIONS_ID_TOKEN_REQUEST_URL carries no query string, & is
swallowed into the path and the JWT gets the default github.com audience —
the registry then rejects it (and release-it only whitelists E401/E404 from
npm whoami, so anything else surfaces as 'Not authenticated').

Step prints JWT claims only (iss/aud/sub/nbf/exp) for both URL forms, the
registry /-/whoami status + body, and npm whoami exactly as release-it
runs it. Never echoes the token. Remove once the fix lands.
@Farenheith
Farenheith merged commit 6f413e7 into master Nov 19, 2026
3 checks passed
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