-
Hi there, I currently use the cool package and I am wondering how f there is an API that I could use to get the approval status of a specific PR? BR, |
Beta Was this translation helpful? Give feedback.
Answered by
offbyone
Apr 25, 2023
Replies: 1 comment
-
Yep: repo = g.repository(owner, repo)
pr = repo.pull_request(PR_NUMBER_AS_STRING)
states = [r.state for r in pr.reviews()] That gets the review statuses.
Checks are the other approving concept and you can get at those using the commits on the PR: most_recent_commit = list(pr.commits())[-1]
runs = list(most_recent_commit.check_runs())
statuses = [r.status for r in runs] |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sigmavirus24
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yep:
That gets the review statuses.
pr.mergeable
andpr.mergeable_state
tell you if the PR is able to merge.Checks are the other approving concept and you can get at those using the commits on the PR: