Skip to content

add temporary OIDC diagnostics to npm publish - #30

Closed
iamalwaysuncomfortable wants to merge 1 commit into
mainfrom
debug/oidc-publish-diagnostics
Closed

add temporary OIDC diagnostics to npm publish#30
iamalwaysuncomfortable wants to merge 1 commit into
mainfrom
debug/oidc-publish-diagnostics

Conversation

@iamalwaysuncomfortable

Copy link
Copy Markdown
Member

Motivation

The first trusted-publishing attempt (v0.2.2) failed with ENEEDAUTH. npm masks all trusted-publishing failures behind generic ENEEDAUTH/E404 errors with no diagnostics (npm/cli#9088), and the Actions runner never logs whether id-token: write was actually granted (actions/runner#3268), so the failure cannot be diagnosed from existing logs.

Two temporary diagnostics:

  • Check OIDC environment step: fails loudly if ACTIONS_ID_TOKEN_REQUEST_URL is absent (meaning the id-token permission was not granted), otherwise prints the decoded OIDC claims npm will present to the registry (repository, workflow_ref, environment, ...) for comparison against the trusted publisher config. Only decoded claims are printed, never the token.
  • NPM_CONFIG_LOGLEVEL: http on the publish step to surface the token-exchange HTTP calls.

Both marked temporary; remove once the first OIDC publish succeeds.

Test Plan

  • YAML validation passes.
  • Re-dispatch Publish to npm with tag v0.2.2 after merge; nothing was published in the failed run, so the retry attempts all six packages with diagnostics active.

Related PRs

The first OIDC publish (v0.2.2) failed with ENEEDAUTH, which npm emits
for any trusted-publishing failure without diagnostics (npm/cli#9088).
Two temporary aids to pinpoint the cause:

- A step that fails loudly if the OIDC environment is absent (the
  runner never logs the id-token permission, actions/runner#3268) and
  prints the decoded claims npm will present to the registry — never
  the token itself.
- http loglevel on the publish step to surface the token-exchange
  calls.
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