Skip to content

Commit 25ae3a7

Browse files
committed
Respect config in .npmrc
1 parent 2ae596f commit 25ae3a7

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
7676
if (await fileExists(userNpmrcPath)) {
7777
core.info("Found existing user .npmrc file");
7878
const userNpmrcContent = await fs.readFile(userNpmrcPath, "utf8");
79-
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);
82-
});
79+
const authLine = userNpmrcContent.includes("_authToken");
8380
if (authLine) {
8481
core.info(
8582
"Found existing auth token for the npm registry in the user .npmrc file"

0 commit comments

Comments
 (0)