Question from my comment here: How to check mergeability of a branches using the github api
Is it possible to check the mergeability of two branches using the github API without making a PR? I dont want to trigger anything by creating a PR, even if I immediately delete the PR afterwards.
You can try and use the GitHub API compare commits (which can be used for branches), as I illustrated here.
That will give you a status:
"status": "behind",
"ahead_by": 1,
"behind_by": 2,
If you see only ahead: the branch will be easily mergeable (fast-forward).
If you see both ahead and behind... there might be conflict, but it is harder to be sure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With