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.
Issue
Type of Work
Description of Work
Problem
Currently, the action attempts to set up the
.npmrcfile using theNPM_TOKENenvironment variable (process.env.NPM_TOKEN).However, inputs passed via with:
npm_token: ${{ secrets.NPM_TOKEN }}in the workflow are not automatically mapped to environment variables.As a result,
process.env.NPM_TOKENisundefined, and the generated.npmrcdoes not contain a valid token.This leads to authentication errors (
ENEEDAUTH) when trying to publish packages to npm.Solution
This PR explicitly retrieves the npm_token input using core.getInput('npm_token') and assigns it to
process.env.NPM_TOKENbefore generating or updating the .npmrc file.This ensures that the npm authentication token is correctly set, and publishing works as expected.
Additional Note
If this action is used internally in other repositories or shared as a company action, similar fixes should be applied there as well to prevent the same issue. cc. @2-one-week
Review Points
Others