Skip to content

Commit 20a6303

Browse files
committed
fix(ci): downgrade npm auth token list check failure to warning
1 parent 652302b commit 20a6303

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.ado/scripts/prepublish-check.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function loadNxConfig(configFile) {
9090
return JSON.parse(nx);
9191
}
9292

93-
export function verifyNpmAuth(registry = NPM_DEFEAULT_REGISTRY) {
93+
function verifyNpmAuth(registry = NPM_DEFEAULT_REGISTRY) {
9494
const npmErrorRegex = /npm error code (\w+)/;
9595
const spawnOptions = {
9696
stdio: /** @type {const} */ ("pipe"),
@@ -103,7 +103,8 @@ export function verifyNpmAuth(registry = NPM_DEFEAULT_REGISTRY) {
103103
if (whoami.status !== 0) {
104104
const error = whoami.stderr.toString();
105105
const m = error.match(npmErrorRegex);
106-
switch (m && m[1]) {
106+
const errorCode = m && m[1];
107+
switch (errorCode) {
107108
case "EINVALIDNPMTOKEN":
108109
throw new Error(`Invalid auth token for npm registry: ${registry}`);
109110
case "ENEEDAUTH":

0 commit comments

Comments
 (0)