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

Fail if GitHub PR creation fails #39

Merged
merged 1 commit into from
Sep 27, 2023
Merged

Fail if GitHub PR creation fails #39

merged 1 commit into from
Sep 27, 2023

Conversation

markgoddard
Copy link

GitHub pull request creation can fail for various reasons [1], and
should return a 4XX code if it does.

Previously the response code was ignored (the default behaviour of
curl), so PR creation could silently fail. This change adds the curl
--fail argument, as is used for Gitlab.

[1] https://docs.github.com/en/free-pro-team@latest/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request--status-codes

GitHub pull request creation can fail for various reasons [1], and
should return a 4XX code if it does.

Previously the response code was ignored (the default behaviour of
curl), so PR creation could silently fail. This change adds the curl
--fail argument, as is used for Gitlab.

[1] https://docs.github.com/en/free-pro-team@latest/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request--status-codes
@markgoddard markgoddard merged commit 564f975 into main Sep 27, 2023
4 checks passed
@markgoddard markgoddard deleted the fix-gh-pr-fail branch September 27, 2023 12:16
Copy link
Contributor

@jackhodgkiss jackhodgkiss left a comment

Choose a reason for hiding this comment

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

LGTM.

The branch will have been pushed to GitHub and will be available for manual PR creation if it does fail during this API request so no changes should be lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants