Files
vercel__workflow/patches/@changesets__cli@2.29.8.patch
T

23 lines
1.7 KiB
Diff

diff --git a/dist/changesets-cli.cjs.js b/dist/changesets-cli.cjs.js
index 0f03e31068a5a7f77ef03ee97684d7f4d5136367..b2bba73c0f10ddbf702fdd2d036277273e28d828 100644
--- a/dist/changesets-cli.cjs.js
+++ b/dist/changesets-cli.cjs.js
@@ -783,7 +783,7 @@ async function internalPublish(packageJson, opts, twoFactorState) {
let json = getLastJsonObjectFromString(stderr.toString()) || getLastJsonObjectFromString(stdout.toString());
if (json !== null && json !== void 0 && json.error) {
// The first case is no 2fa provided, the second is when the 2fa is wrong (timeout or wrong words)
- if ((json.error.code === "EOTP" || json.error.code === "E401" && json.error.detail.includes("--otp=<code>")) && !ciInfo.isCI) {
+ if ((json.error.code === "EOTP" || json.error.code === "E401" && typeof json.error.detail === "string" && json.error.detail.includes("--otp=<code>")) && !ciInfo.isCI) {
if (twoFactorState.token !== null) {
// the current otp code must be invalid since it errored
twoFactorState.token = null;
@@ -792,7 +792,7 @@ async function internalPublish(packageJson, opts, twoFactorState) {
twoFactorState.isRequired = Promise.resolve(true);
return internalPublish(packageJson, opts, twoFactorState);
}
- logger.error(`an error occurred while publishing ${packageJson.name}: ${json.error.code}`, json.error.summary, json.error.detail ? "\n" + json.error.detail : "");
+ logger.error(`an error occurred while publishing ${packageJson.name}: ${json.error.code}`, json.error.summary ?? json.error.message ?? "", json.error.detail ? "\n" + json.error.detail : "");
}
logger.error(stderr.toString() || stdout.toString());
return {