Setup node produces incorrect .npmrc file
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
Hello @aqeelat, Thank you for creating this issue and we will look into it :)
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:
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.
Hi @aqeelat, Just a gentle reminder regarding the issue. Could you please share any updates or a minimal reproduction of the issue?
Hi @priyagupta108, Can you confirm that your repo did not already have a .npmrc?
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.
Hi @aqeelat, just giving you a gentle ping to see if there are any updates on your end regarding this issue? Thank you!
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.