File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -160,14 +160,10 @@ function verifyNpmAuth(registry = NPM_DEFEAULT_REGISTRY) {
160160 const whoamiArgs = [ "npm" , "whoami" , "--publish" ] ;
161161 const whoami = spawnSync ( "yarn" , whoamiArgs , spawnOptions ) ;
162162 if ( whoami . status !== 0 ) {
163- const stderr = whoami . stderr . toString ( ) . trim ( ) ;
164- const stdout = whoami . stdout . toString ( ) . trim ( ) ;
165- const errorOutput = stderr || stdout || 'No error message available' ;
166-
167- // Yarn uses different error format
168- if ( errorOutput . includes ( "Invalid authentication" ) || errorOutput . includes ( "Failed with errors" ) ) {
169- throw new Error ( `Invalid or missing auth token for registry: ${ registry } ` ) ;
170- }
163+ const errorOutput =
164+ whoami . stderr . toString ( ) . trim ( ) ||
165+ whoami . stdout . toString ( ) . trim ( ) ||
166+ 'No error message available' ;
171167
172168 // Provide more context about the yarn authentication failure
173169 throw new Error ( `Yarn authentication failed (exit code ${ whoami . status } ): ${ errorOutput } ` ) ;
You can’t perform that action at this time.
0 commit comments