Open borisivan opened 5 years ago
learning more about how this works -- I suspect that this only takes into consideration if there is a git conflict. But if anything that prevents a PR from being merged (reviewers, required status checks, etc) are currently active for a PR.... isMergeable is still true.
Would love to see a solution somehow to really know "is it mergeable".
Have you tried calling pullRequest.refresh()
before rechecking the flag? Solely reading the flag doesn't trigger querying the API.
in a PR I have a pending status check. and the repo settings have branch protection with the setting: "Require status checks to pass before merging", and the status check in question is listed.
I have a test with the following code:
.... yet it's always 'true'. I even made sure the repo settings had the configuration for "Enforce all configured restrictions for administrators."
I had a window up to the github UI that I was refreshing after I made a small change to the branch and pushed to github. The PR instantly went to having they merge button greyed out as soon as it received the push, and stayed grey as I spammed the refresh button on my browser, and immediately went to mergeable (in the UI) only when the createStatus command was executed in the code above.
But pullRequest.mergeable appears to always be true, even though the github UI is saying that the PR is not mergeable until I set that statusCheck to success. Any ideas?