问题描述
我需要PR的审阅者列表,以及审阅请求API 出现在Github中仅向我提供了所请求的审阅者,一旦审阅者接受了邀请,该评论即为空.我还尝试了评论API 来获取所有评论,然后获得唯一用户,但是这似乎仅适用于输入一个的用户,而不适用于已接受请求审阅邀请但从未发布过审阅的用户.
I need the list of reviewers for a PR, and the Review Requests API present in Github only provides me the requested reviewers which becomes empty once the reviewers have accepted their invitations. I also tried the Reviews API to get all reviews and then get unique users, but that seems to be only for users who enter one and not for those who have accepted the request review invitation and never posted a review.
推荐答案
只是通过以下解决方案解决了这个问题.
Just went through this problem with the following solution.
根据 GitHub的文档:
GET /repos/:owner/:repo/pulls/:pull_number/requested_reviewers
测试请求:
https://api.github.com/repos/roliveiravictor/demo-rust-learning/pulls/1/requested_reviewers
响应:
{
"users": [],
"teams": []
}
由于没有人愿意为此公开测试存储库下定决心,因此它当然是空的.请记住,他们需要在您的存储库上具有写权限.在我的私人项目上,效果很好.
Since nobody is settle on this public test repo, of course it's empty. Remember, they need to have write access on your repository. This worked pretty well on my private project.
这篇关于如何使用Github API获取请求请求的审阅者列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!