GitHub API - 获取作者对存储库的评论总数

标签 github github-api

我知道我可以获取给定用户打开的 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/

相关文章:

git - 如何从现有存储库导入存储库及其 pull 请求

github - 如何删除问题引用

ruby-on-rails - Github 上组织的 Repos 列表(公共(public)和私有(private))

curl - Github API 错误 - { "message": "Not Found", "documentation_url": "https://developer.github.com/v3"} 在 cURL 终端中制作 repo

javascript - 如何在预检请求中强制进行身份验证?

github - 如何使用 github api 查找批准拉取请求的用户?

git - 如何从 Github (Enterprise) 中提取我在本地没有的提交?

PHP 在主项目的vendor下开发一个composer包

xcode - 错误:尝试 devtools::install_github() 时出现 "Could not find build tools necessary to build stringi"

基于字段特定值的 GraphQL 查询