我知道我可以获取给定用户打开的 PR 数量
https://api.github.com/search/issues?q=is:pr+repo:<owner>/<repo>+author:<username>+is:open
但是特定用户审核的 PR 数量又如何呢?
最佳答案
这似乎在 v3 (REST) API 中不可用,但我在 v4 (GraphQL) API 中找到了 totalPullRequestReviewContributions
。
{
user(login: "nickmccurdy") {
contributionsCollection {
totalPullRequestReviewContributions
}
}
}
进行 GraphQL 查询后,您将获得此 JSON 结果。仅应更改 totalPullRequestReviewContributions
的数量。
{
"data": {
"user": {
"contributionsCollection": {
"totalPullRequestReviewContributions": 80
}
}
}
}
由于这是使用 v4 (GraphQL) API,因此您可以从 GraphiQL API Explorer 进行测试:https://developer.github.com/v4/explorer/
关于GitHub API - 获取作者对存储库的评论总数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62621357/