GitHub API - 获取作者对存储库的评论总数
GitHub API - get total number of reviews by an author on a repository
我知道我可以通过
获取给定用户打开的 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/
我知道我可以通过
获取给定用户打开的 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/