From ffa16916af37744b5294f09f120e80f6103effd5 Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Tue, 2 Apr 2024 20:49:54 -0700 Subject: [PATCH 1/2] Check for fatal on every line of stderr of the git command --- src/git.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/git.ts b/src/git.ts index 581e1a86ac..8ef37b4af2 100644 --- a/src/git.ts +++ b/src/git.ts @@ -314,8 +314,9 @@ export async function deploy(action: ActionInterface): Promise { // If the push failed for any fatal reason other than being rejected, // there is a problem - if (!rejected && pushResult.stderr.trim().startsWith('fatal:')) + if (!rejected && pushResult.stderr.split(/\n/).some(s => s.trim().startsWith('fatal:')) { throw new Error(pushResult.stderr) + } } while (rejected) } From 71625425020468ef98e51e163c868731f22300dd Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Wed, 3 Apr 2024 23:06:26 -0700 Subject: [PATCH 2/2] Fix syntax error --- src/git.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git.ts b/src/git.ts index 8ef37b4af2..3dae53bf29 100644 --- a/src/git.ts +++ b/src/git.ts @@ -314,7 +314,7 @@ export async function deploy(action: ActionInterface): Promise { // If the push failed for any fatal reason other than being rejected, // there is a problem - if (!rejected && pushResult.stderr.split(/\n/).some(s => s.trim().startsWith('fatal:')) { + if (!rejected && pushResult.stderr.split(/\n/).some(s => s.trim().startsWith('fatal:'))) { throw new Error(pushResult.stderr) } } while (rejected)