列出对 github 中用户的任何存储库(不仅是拥有的存储库)的贡献

发布于 2025-01-10 21:34:33 字数 257 浏览 0 评论 0原文

我有一个非常简单的问题。我试图找出 github 用户贡献的存储库,但我无法。例如,在此帐户中 https://github.com/goodfeli。如何查看该用户贡献的所有存储库?

通过单击存储库,我只能列出该用户创建的存储库。此外,我知道固定存储库可以显示该用户贡献的任何存储库,但最多只能列出 6 个。所以我可以弄清楚如何列出所有这些存储库。

I have a very simple question. I am trying to figure out the repositories a github user has contributed to and I am unable. So for example in this account https://github.com/goodfeli. How can I check all the repositories this user has contributed to?

By clicking into repositories I can only list the repositories created by this user. Moreover, I know the pinned repositories can show any repository this user has contributed to but it can only list up to 6. So I can figure out how to list them all.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染年凉城似染瑾 2025-01-17 21:34:33

您可以使用 GraphQL API 来获取用户为不同类别做出贡献的 100 个存储库。这将显示可通过您正在验证的令牌访问的存储库。

这是一个查询(将 octocat 替换为用户的登录名):

query {
  user(login: "octocat") {
    contributionsCollection {
      commitContributionsByRepository(maxRepositories: 100) {
        repository {
          nameWithOwner
        }
      }
      issueContributionsByRepository(maxRepositories: 100) {
        repository {
          nameWithOwner
        }
      }
      pullRequestReviewContributionsByRepository(maxRepositories: 100) {
        repository {
          nameWithOwner
        }
      }
      pullRequestContributionsByRepository(maxRepositories: 100) {
        repository {
          nameWithOwner
        }
      }
    }
  }
}

最简单的方法是使用 GitHub 的 GraphQL Explorer 您可以在其中优化/调整您的查询。

您在问题中提到的用户显然没有我的经过身份验证的用户可以访问的贡献,因此结果为空:

{
  "data": {
    "user": {
      "contributionsCollection": {
        "commitContributionsByRepository": [],
        "issueContributionsByRepository": [],
        "pullRequestReviewContributionsByRepository": [],
        "pullRequestContributionsByRepository": []
      }
    }
  }
}

You can use the GraphQL API to get up to 100 repositories where a user contributed to for various categories. This displays repositories that are accessible by the token you are authenticating with.

Here is a query (replace octocat with the login of the user):

query {
  user(login: "octocat") {
    contributionsCollection {
      commitContributionsByRepository(maxRepositories: 100) {
        repository {
          nameWithOwner
        }
      }
      issueContributionsByRepository(maxRepositories: 100) {
        repository {
          nameWithOwner
        }
      }
      pullRequestReviewContributionsByRepository(maxRepositories: 100) {
        repository {
          nameWithOwner
        }
      }
      pullRequestContributionsByRepository(maxRepositories: 100) {
        repository {
          nameWithOwner
        }
      }
    }
  }
}

The simplest way is to use GitHub's GraphQL Explorer where you can refine/adjust your query.

The user you are mentioning in your question apparently has no contributions that are accessible with my authenticated user, thus the result is empty:

{
  "data": {
    "user": {
      "contributionsCollection": {
        "commitContributionsByRepository": [],
        "issueContributionsByRepository": [],
        "pullRequestReviewContributionsByRepository": [],
        "pullRequestContributionsByRepository": []
      }
    }
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文