API - Getting the reason that a pull request isn't mergeable? #21886
-
I can use the pull requests api to see whether a PR is mergeable, and I can use the status api to check custom statuses logged for a given commit, but how can I fetch the reason that a PR is blocked from merging (e.g. it could be merge conflicts, review obligations, commit status)? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There isn’t an API that summarizes why a PR is mergeable or not, only that it is or isn’t. In the documentation it states:
We don’t record the result of why, only yes, no, or not yet computed. I hope that helps 👍 |
Beta Was this translation helpful? Give feedback.
-
I also found the undocumented attribute Thanks! |
Beta Was this translation helpful? Give feedback.
I also found the undocumented attribute
mergeable_state
, which gives a little more info: it can beclean
,dirty
,blocked
,unstable
, orunknown
. It seems likedirty
means merge conflicts, so that’s been granular enough for me for now.Thanks!