Skip to content

Commit 1549c16

Browse files
committed
Respect config in .npmrc
1 parent c831d73 commit 1549c16

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
5959
if (fs.existsSync(userNpmrcPath)) {
6060
console.log("Found existing user .npmrc file");
6161
const userNpmrcContent = await fs.readFile(userNpmrcPath, "utf8");
62-
const authLine = userNpmrcContent.split("\n").find((line) => {
63-
// check based on https://github.com/npm/cli/blob/8f8f71e4dd5ee66b3b17888faad5a7bf6c657eed/test/lib/adduser.js#L103-L105
64-
return /^\s*\/\/registry\.npmjs\.org\/:[_-]authToken=/i.test(line);
65-
});
62+
const authLine = userNpmrcContent.includes("_authToken");
63+
// const authLine = userNpmrcContent.split("\n").find((line) => {
64+
// // check based on https://github.com/npm/cli/blob/8f8f71e4dd5ee66b3b17888faad5a7bf6c657eed/test/lib/adduser.js#L103-L105
65+
// return /^\s*\/\/registry\.npmjs\.org\/:[_-]authToken=/i.test(line);
66+
// });
6667
if (authLine) {
6768
console.log(
6869
"Found existing auth token for the npm registry in the user .npmrc file"

0 commit comments

Comments
 (0)