如何使用Github API获取请求请求的审阅者列表?

问题描述:

我需要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

拉动请求作者,存储库所有者和协作者可以 向具有写入权限的任何人请求拉取请求审核 资料库.每个请求的审阅者都会收到一条通知,询问 他们审核拉动请求.

Pull request authors and repository owners and collaborators can request a pull request review from anyone with write access to the repository. Each requested reviewer will receive a notification asking them to review the pull request.

测试请求:

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.