Skip to content

Fail action when PR is not mergeable - #177

Merged
pascalgn merged 2 commits into
pascalgn:mainfrom
roryabraham:Rory-FailActionWhenPRNotMergeable
Mar 24, 2022
Merged

pascalgn merged 2 commits into
pascalgn:mainfrom
roryabraham:Rory-FailActionWhenPRNotMergeable

Conversation

@roryabraham

@roryabraham roryabraham commented Dec 21, 2021 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@AndrewGable

Copy link
Copy Markdown

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
Copy Markdown
Owner

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

@roryabraham

Copy link
Copy Markdown
Contributor Author

@pascalgn thanks for the tip, that worked! 🎉

@Austio

Austio commented Feb 4, 2022

Copy link
Copy Markdown

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

@roryabraham

Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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