Skip to content

Setup node produces incorrect .npmrc file #995

Closed
@aqeelat

Description

@aqeelat

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions