Skip to content

Commit 8ba321c

Browse files
committed
Respect config in .npmrc
1 parent 2ae596f commit 8ba321c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
7777
core.info("Found existing user .npmrc file");
7878
const userNpmrcContent = await fs.readFile(userNpmrcPath, "utf8");
7979
const authLine = userNpmrcContent.split("\n").find((line) => {
80-
// check based on https://github.com/npm/cli/blob/8f8f71e4dd5ee66b3b17888faad5a7bf6c657eed/test/lib/adduser.js#L103-L105
81-
return /^\s*\/\/registry\.npmjs\.org\/:[_-]authToken=/i.test(line);
80+
// npm auth lines: //<host[/path]>/:_authToken= (see npm cli adduser tests)
81+
return /^\s*\/\/.+\/:[_-]authToken=/i.test(line);
8282
});
8383
if (authLine) {
8484
core.info(

0 commit comments

Comments
 (0)