Skip to content

Remove dummy NODE_AUTH_TOKEN export#1558

Open
gowridurgad wants to merge 1 commit into
actions:mainfrom
gowridurgad:removes-token-dummy
Open

Remove dummy NODE_AUTH_TOKEN export#1558
gowridurgad wants to merge 1 commit into
actions:mainfrom
gowridurgad:removes-token-dummy

Conversation

@gowridurgad
Copy link
Copy Markdown
Contributor

Description:
The action previously exported a dummy NODE_AUTH_TOKEN value (XXXXX-XXXXX-XXXXX-XXXXX) when no token was provided. While this didn't break OIDC flows, it could corrupt the user's .npmrc by injecting a non-functional token value into the environment, potentially causing confusing behavior during OIDC publish. This PR removes the dummy fallback and only exports NODE_AUTH_TOKEN when the user has explicitly set it.

Related issue:
#1440

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@gowridurgad gowridurgad requested a review from a team as a code owner May 26, 2026 14:40
Copilot AI review requested due to automatic review settings May 26, 2026 14:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the previous dummy fallback value for NODE_AUTH_TOKEN during registry auth setup, so the action only exports NODE_AUTH_TOKEN when it is explicitly present in the environment—preventing unintended token injection that can interfere with npm OIDC publishing flows.

Changes:

  • Stop exporting a placeholder NODE_AUTH_TOKEN when the variable is not set.
  • Preserve behavior for explicitly set tokens, including an explicit empty-string token.
  • Update the compiled dist output and add unit tests covering the new export behavior.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/authutil.ts Gate NODE_AUTH_TOKEN export behind an explicit presence check in process.env.
dist/setup/index.js Regenerated compiled output reflecting the new export behavior.
__tests__/authutil.test.ts Adds coverage for “not set” and “set to empty string” NODE_AUTH_TOKEN cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants