8000 Check for fatal on every line of stderr of the git command (#1551) · CasP0/github-pages-deploy-action@f44e4c6 · GitHub
[go: up one dir, main page]

Skip to content

Commit f44e4c6

Browse files
authored
Check for fatal on every line of stderr of the git command (JamesIves#1551)
* Check for fatal on every line of stderr of the git command * Fix syntax error
1 parent 4879db2 commit f44e4c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/git.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,9 @@ export async function deploy(action: ActionInterface): Promise<Status> {
314314

315315
// If the push failed for any fatal reason other than being rejected,
316316
// there is a problem
317-
if (!rejected && pushResult.stderr.trim().startsWith('fatal:'))
317+
if (!rejected && pushResult.stderr.split(/\n/).some(s => s.trim().startsWith('fatal:'))) {
318318
throw new Error(pushResult.stderr)
319+
}
319320
} while (rejected)
320321
}
321322

0 commit comments

Comments
 (0)
0