Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup node produces incorrect .npmrc file #995

Closed
aqeelat opened this issue Apr 3, 2024 · 7 comments
Closed

Setup node produces incorrect .npmrc file #995

aqeelat opened this issue Apr 3, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@aqeelat
Copy link

aqeelat commented Apr 3, 2024

Description:
The .npmrc file created by the action does not match what is specified in https://docs.npmjs.com/cli/v10/configuring-npm/npmrc/
Primarily, it copies the exact registry-url without stripping the protocol when creating the auth parameter.

For example:

- uses: actions/setup-node@v4
  env:
    NODE_AUTH_TOKEN: "MyAuthToken"
  with:
    registry-url: 'https://my-repo.example.com/npm-private/'
    scope: 'myscope'

Results in:

https://my-repo.example.com/npm-private/:_authToken=${NODE_AUTH_TOKEN}
@myscope:registry=https://my-repo.example.com/npm-private/

Instead of

//my-repo.example.com/npm-private/:_authToken=${NODE_AUTH_TOKEN}
@myscope:registry=https://my-repo.example.com/npm-private/

Action version:
v4

@aqeelat aqeelat added bug Something isn't working needs triage labels Apr 3, 2024
@aparnajyothi-y
Copy link
Contributor

Hello @aqeelat, Thank you for creating this issue and we will look into it :)

@priyagupta108 priyagupta108 self-assigned this Jul 8, 2024
@priyagupta108
Copy link
Contributor

Hello @aqeelat👋,
Thank you for your report. I have tested the functionality and the .npmrc file is generated correctly. Here’s the screenshot from my test run:
Screenshot

For your reference, you can find the relevant code related to this functionality in the setup-node repository here.
As I am unable to reproduce the issue on my end, could you please provide a link to a minimal reproduction of the issue so we can investigate further?
Looking forward to your response.

@priyagupta108
Copy link
Contributor

Hi @aqeelat,
Just a gentle reminder regarding the issue. Could you please share any updates or a minimal reproduction of the issue?

@aqeelat
Copy link
Author

aqeelat commented Jul 29, 2024

Hi @priyagupta108,
Can you confirm that your repo did not already have a .npmrc?

@priyagupta108
Copy link
Contributor

Hello @aqeelat,
Thank you for your response.
I can confirm that my repository did not have a pre-existing .npmrc file before running the action.

@priyagupta108
Copy link
Contributor

Hi @aqeelat,
just giving you a gentle ping to see if there are any updates on your end regarding this issue? Thank you!

@priyagupta108
Copy link
Contributor

Hello @aqeelat ,
Due to inactivity, I'm going to close this issue for now. Please feel free to reopen this issue or create a new one if necessary. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants