Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect PRs with "Review required" in GitHub API

Using the GitHub API, I can't seem to detect if a pull request is in "Review required" status (as setup from https://docs.github.com/en/github/administering-a-repository/enabling-required-reviews-for-pull-requests).

It's not listed in the PR description in https://api.github.com/repos/my_company/my_project/pulls and the status list from https://api.github.com/repos/my_company/my_project/statuses/abc123 only shows TravisCI statuses.

Since no review has happened, the comments from https://api.github.com/repos/my_company/my_project/pulls/123/comments are also empty (as expected, I just checked it to see if it also had review status).

So, is there an API call I'm missing that'll clearly indicate if a PR is in "Review required" status?

like image 589
celadonz Avatar asked Oct 29 '22 17:10

celadonz


1 Answers

Nov. 2016: No there does not seem to be a direct API.

You can see all the future API evolution in API Previews, and again there is nothing regarding reviews.
That would be a feature request for GitHub support.

Update January 2017, as mentioned by the OP celadonz in the comments, listing reviews on PR is in beta.

2020: Since then, as commented by Benjamin W., the official documentation is rest/reference/pulls#reviews, and it is indeed out of beta.

like image 143
VonC Avatar answered Jan 02 '23 20:01

VonC