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

编程入门 行业动态 更新时间:2024-10-14 16:23:41
本文介绍了如何使用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.

测试请求:

api.github/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获取请求请求的审阅者列表?

本文发布于:2023-11-28 18:22:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643460.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   列表   Github   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!