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

Create GH Action to reliably determine mergeability #1847

Merged
merged 7 commits into from
Mar 17, 2021

Conversation

roryabraham
Copy link
Contributor

Details

When getting ready to automerge a PR, we want to first make sure that it's mergeable. However, Github uses a background job to calculate mergeability... from the GH docs:

The value of the mergeable attribute can be true, false, or null. If the value is null, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-null value for the mergeable attribute in the response. If mergeable is true, then merge_commit_sha will be the SHA of the test merge commit

So we can't rely on the boolean result of the mergeable attribute to be readily available. This PR creates a custom Github Action to continually poll mergeability of a PR until the result is non-null, and output the end result.

Fixed Issues

Fixes failed workflow run: https://github.com/Expensify/Expensify.cash/runs/2133374703?check_suite_focus=true

Tests

Added automated tests for the new JS action.

Need to test it's usage in the workflow by merging this PR.

@roryabraham roryabraham self-assigned this Mar 17, 2021
@roryabraham roryabraham requested a review from a team as a code owner March 17, 2021 21:10
@botify botify requested review from jasperhuangg and removed request for a team March 17, 2021 21:10
@roryabraham roryabraham merged commit 13fb5fd into master Mar 17, 2021
@roryabraham roryabraham deleted the Rory-ReliableMergeability branch March 17, 2021 23:47
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants