Skip to content

Change of registry is being ignored #763

@piranna

Description

@piranna

Description:

I'm publishing a package to both GPR and npm, in that order. Execution of setup-node works well, but publishing to npm fails because it's still trying to do it to GPR.

Action version:
v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
Default ones.

node: v18.16.0
npm: 9.5.1

Repro steps:
Workflow available at https://github.com/Mafalda-SFU/mediasoup/actions/runs/5129548473/jobs/9227484918

Use setup-node with default registry-url, and npm ci works ok.
Use again setup-node with GPR registry-url, publish works ok.
Use again setup-node with npm registry-url, publish fails because it's still using GPR registry. I've reviewed the code, and by

curContents.split(os.EOL).forEach((line: string) => {
// Add current contents unless they are setting the registry
if (!line.toLowerCase().startsWith(`${scope}registry`)) {
newContents += line + os.EOL;
}
});
previous one should have been ignored, or at least it should have been overwritten later at
newContents += `${authString}${os.EOL}${registryString}${os.EOL}${alwaysAuthString}`;
.

Expected behavior:
Second call to setup-node defining registry-url should update it for all the next commands.

Actual behavior:
Once registry-url is set, it's being preserved for all the next commands.

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