- Notifications
You must be signed in to change notification settings - Fork410
-
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, |
BetaWas this translation helpful?Give feedback.
All reactions
Yep:
repo=g.repository(owner,repo)pr=repo.pull_request(PR_NUMBER_AS_STRING)states= [r.stateforrinpr.reviews()]
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:
most_recent_commit=list(pr.commits())[-1]runs=list(most_recent_commit.check_runs())statuses= [r.statusforrinruns]
Replies: 1 comment
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Yep: repo=g.repository(owner,repo)pr=repo.pull_request(PR_NUMBER_AS_STRING)states= [r.stateforrinpr.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.statusforrinruns] |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
This discussion was converted from issue #1133 on April 26, 2023 00:37.