Skip to content

👷 [RUM-15055] fix npm publish OIDC auth after v0.1.3#89

Merged
bcaudan merged 2 commits into
mainfrom
bcaudan/fix-npm-publish-6
Apr 8, 2026
Merged

👷 [RUM-15055] fix npm publish OIDC auth after v0.1.3#89
bcaudan merged 2 commits into
mainfrom
bcaudan/fix-npm-publish-6

Conversation

@bcaudan

@bcaudan bcaudan commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

Motivation

npm publishes have been failing since v0.1.0. Root cause: the npm Trusted Publishers config had @DataDog in the "Organization or user" field, but npm matches it exactly against the JWT repository_owner claim (DataDog, no @), returning "OIDC token exchange error - package not found".

Secondary: registry-url in actions/setup-node writes .npmrc with _authToken=${NODE_AUTH_TOKEN}, causing ENEEDAUTH if OIDC fails.

Changes

  • Replace the simple dry-run with a comprehensive OIDC verification: checks GitHub OIDC pre-conditions, performs the token exchange, displays JWT claims for diagnostics, and validates the build pack
  • Remove registry-url from actions/setup-node to eliminate the .npmrc _authToken fallback
  • Remove NODE_AUTH_TOKEN: '' workarounds

Test instructions

  1. Trigger the publish workflow with dry_run: true from a tag — all OIDC checks should pass (✅ npm OIDC token obtained, ✅ dry-run pack succeeded)
  2. The .npmrc warning should no longer appear in the dry-run output

Checklist

  • Tested locally (playground)
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated related documentation.

bcaudan added 2 commits April 8, 2026 14:21
- check ACTIONS_ID_TOKEN_REQUEST_URL is set (id-token: write pre-condition)
- report .npmrc state as diagnostic
- exchange OIDC token with npm registry using correct endpoint and auth header
- decode JWT claims for easier Trusted Publishers diagnosis
- collect all failures before exiting
- Drop registry-url from actions/setup-node: it writes .npmrc with
  _authToken=${NODE_AUTH_TOKEN} which would cause ENEEDAUTH if OIDC
  ever fails, since npm falls back to the empty token
- Remove NODE_AUTH_TOKEN: '' workarounds (no longer needed)
@bcaudan bcaudan marked this pull request as ready for review April 8, 2026 12:29
@bcaudan bcaudan requested a review from a team as a code owner April 8, 2026 12:29
@bcaudan bcaudan merged commit 8925082 into main Apr 8, 2026
14 checks passed
@bcaudan bcaudan deleted the bcaudan/fix-npm-publish-6 branch April 8, 2026 12:51
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.

2 participants