Remove dummy NODE_AUTH_TOKEN export#1558
Open
gowridurgad wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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_TOKENwhen the variable is not set. - Preserve behavior for explicitly set tokens, including an explicit empty-string token.
- Update the compiled
distoutput 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: