Skip to content

Conversation

@Satishchoudhary94
Copy link

Problem

The action was exporting a fake NODE_AUTH_TOKEN value (XXXXX-XXXXX-XXXXX-XXXXX) by default,
which broke NPM OIDC authentication. OIDC requires NODE_AUTH_TOKEN to be either unset or empty.

Solution

Only export NODE_AUTH_TOKEN if it was explicitly provided by the user.

Changes

  • Modified configAuthentication() in authutil.ts to check if NODE_AUTH_TOKEN exists before exporting
  • Added tests to verify OIDC behavior

Testing

  • All authutil tests pass (15/15)
  • OIDC authentication now works properly
  • Backward compatible with users who explicitly provide tokens

…ODE_AUTH_TOKEN

This change addresses issue actions#1440 where NPM OIDC authentication was broken
because the action was exporting a fake NODE_AUTH_TOKEN value by default.

NPM OIDC requires NODE_AUTH_TOKEN to either be unset or empty for proper
authentication. The fix only exports NODE_AUTH_TOKEN if it was explicitly
set by the user, allowing OIDC to work while maintaining backward compatibility
for users who explicitly provide tokens.

BREAKING CHANGE: Users who rely on the fake default token should now explicitly
provide NODE_AUTH_TOKEN in their workflows or use OIDC authentication.

Fixes actions#1440
Related: actions#1440
@Satishchoudhary94 Satishchoudhary94 requested a review from a team as a code owner January 18, 2026 14:14
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