diff --git a/src/index.ts b/src/index.ts index d8d1cc9d..d6060658 100644 --- a/src/index.ts +++ b/src/index.ts @@ -77,8 +77,8 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined; core.info("Found existing user .npmrc file"); const userNpmrcContent = await fs.readFile(userNpmrcPath, "utf8"); const authLine = userNpmrcContent.split("\n").find((line) => { - // check based on https://github.com/npm/cli/blob/8f8f71e4dd5ee66b3b17888faad5a7bf6c657eed/test/lib/adduser.js#L103-L105 - return /^\s*\/\/registry\.npmjs\.org\/:[_-]authToken=/i.test(line); + // URL-shaped registry key + :_authToken=… (http(s):// or //) + return /^\s*(?:https?:\/\/|\/\/).+:[_-]authToken=/i.test(line); }); if (authLine) { core.info(