Skip to content
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

Check for fatal on every line of stderr of the git command #1551

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,9 @@

// 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:')) {

Check failure on line 317 in src/git.ts

View workflow job for this annotation

GitHub Actions / build

')' expected.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is flagging a syntax error:

/home/runner/work/github-pages-deploy-action/github-pages-deploy-action/src/git.ts
  317:96  error  Parsing error: ')' expected

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's my bad! Thought the change was too trivial to test but Murphy's law is quite right. Fixed now.

throw new Error(pushResult.stderr)
}
} while (rejected)
}

Expand Down
Loading