From 374b4c272b87920e1642acec3b4c91c7196718c3 Mon Sep 17 00:00:00 2001 From: emerald Date: Thu, 22 Aug 2024 09:15:18 -0400 Subject: [PATCH] exit early if publishing fails --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 5d08e3d..ece9339 100644 --- a/index.ts +++ b/index.ts @@ -31,10 +31,10 @@ const publish = async (target: string, file: string | undefined) => { }); const out = pub.stdout.toString(); - console.log(out); if (pub.exitCode !== 0 || out.toLowerCase().includes("error")) { console.log("::error::Tcli encountered an error while publishing"); - console.log(`::error::${pub.stderr}`); + console.log(`::error::${out}`); + process.exit(1); } const url = out.match(/https.*/g)?.[0];