Skip to content

Conversation

@yujeong-jeon
Copy link
Contributor

@yujeong-jeon yujeong-jeon commented May 7, 2025

Issue

Type of Work

  • Bug Fix
  • Feature Addition
  • Code Improvement

Description of Work

Problem

Currently, the action attempts to set up the .npmrc file using the NPM_TOKEN environment 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_TOKEN is undefined, and the generated .npmrc does 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_TOKEN before 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

@yujeong-jeon yujeong-jeon requested a review from a team as a code owner May 7, 2025 14:06
@yujeong-jeon
Copy link
Contributor Author

yujeong-jeon commented May 7, 2025

Copy link
Contributor

@yceffort-naver yceffort-naver left a comment

Choose a reason for hiding this comment

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

LGTM!

@yujeong-jeon yujeong-jeon merged commit efbad94 into main May 7, 2025
6 checks passed
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