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 action when PR is not mergeable #177

Merged
merged 2 commits into from
Mar 24, 2022

Conversation

roryabraham
Copy link
Contributor

@roryabraham roryabraham commented Dec 21, 2021

Hello @pascalgn πŸ‘‹

Coming from this comment – this action fails silently when the pull request fails to merge. Instead, the action should exit with a non-zero exit code so that the workflow can properly handle the failure.

This PR does that by introducing a fail method which uses core.setFailed to set an error message and process.exit(1) to fail the action.

The change is covered by an automated unit test.

@roryabraham
Copy link
Contributor Author

The circleci failures we're seeing here seem unrelated to my changes.

@AndrewGable
Copy link

The CircleCI error seems like a known error that can be fixed via a node option flag --openssl-legacy-provider, @pascalgn would you like us to fix that error in this PR or another one?

@pascalgn
Copy link
Owner

The CircleCI error should be fixed via updating the node version, could you rebase the branch?

@roryabraham
Copy link
Contributor Author

@pascalgn thanks for the tip, that worked! πŸŽ‰

@Austio
Copy link

Austio commented Feb 4, 2022

@pascalgn anything that I can do to help get this over the line?

@roryabraham
Copy link
Contributor Author

@pascalgn Friendly reminder about this PR πŸ™‚ We use this action heavily in our CI but the fact that it fails silently is a pain point we would love to resolve.

@mbiagetti
Copy link

Hi @pascalgn Any updates/idea if this feature could be shipped? Thanks!

@pascalgn pascalgn force-pushed the Rory-FailActionWhenPRNotMergeable branch from be28fa3 to a696b87 Compare March 24, 2022 22:27
@pascalgn pascalgn force-pushed the Rory-FailActionWhenPRNotMergeable branch from a696b87 to 8d853da Compare March 24, 2022 22:28
@pascalgn pascalgn merged commit 8cca5df into pascalgn:main Mar 24, 2022
@pascalgn
Copy link
Owner

Thanks for the PR, it's merged now! It took some more time, because I had to put this behaviour behind a new option (MERGE_ERROR_FAIL), to not break existing workflows. Thanks! πŸš€

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.

5 participants