setup-node icon indicating copy to clipboard operation
setup-node copied to clipboard

Setup node produces incorrect .npmrc file

Open aqeelat opened this issue 1 year ago • 4 comments

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 avatar Apr 03 '24 16:04 aqeelat

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

aparnajyothi-y avatar Apr 04 '24 13:04 aparnajyothi-y

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 avatar Jul 09 '24 04:07 priyagupta108

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

priyagupta108 avatar Jul 24 '24 04:07 priyagupta108

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

aqeelat avatar Jul 29 '24 18:07 aqeelat

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 avatar Aug 01 '24 05:08 priyagupta108

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

priyagupta108 avatar Aug 14 '24 06:08 priyagupta108

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.

priyagupta108 avatar Aug 23 '24 12:08 priyagupta108