-
Notifications
You must be signed in to change notification settings - Fork 157
ci: check yarnrc if it exists #2608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| // Yarn uses different error format | ||
| if (errorOutput.includes("Invalid authentication") || errorOutput.includes("Failed with errors")) { | ||
| throw new Error(`Invalid or missing auth token for registry: ${registry}`); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't have this block at all. The catch all below is fine.
| const stderr = whoami.stderr.toString().trim(); | ||
| const stdout = whoami.stdout.toString().trim(); | ||
| const errorOutput = stderr || stdout || 'No error message available'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that it matters much, but this is throws away less work:
| const stderr = whoami.stderr.toString().trim(); | |
| const stdout = whoami.stdout.toString().trim(); | |
| const errorOutput = stderr || stdout || 'No error message available'; | |
| const errorOutput = | |
| whoami.stderr.toString().trim() || | |
| whoami.stdout.toString().trim() || | |
| 'No error message available'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add these suggestions to my other open PR
Summary:
Our
prepublish-checkassumed we used a.npmrcfile to publish. However, we're now using Yarn V4 which uses its'.yarnrc.ymlto set your registry and auth token. Update the check to handle both.