I’m using a webhook to get information of a pull request, and I’d like to identify the mergeability of a pull request.
The following is the case:
I’d like to move a JIRA ticket status if a specific GH Team’s member has approved the pull request. I should not do anything if anyone else has approved it. Codeowners is set, working as expected.
First I looked for the webhookData.review.state whether it is “approved”, but that is returning approved if a non-codeowner has approved it. In this case GH interface shows that the merging is blocked and code owner review required and the button is disabled, but I get “approved” via the webhook.
Then I checked if the webhookData.pull_request.mergeable works, but that looks for code conflicts, not approvals.
How could I retrieve the actual mergeability of a pull request via webhook?