【问题标题】:How to I get all open pull requests opened by my user with github api?如何让我的用户使用 github api 打开所有打开的拉取请求?
【发布时间】:2020-01-09 10:59:53
【问题描述】:

如何获取用户使用 github api 打开的所有打开的拉取请求?

我希望从 Python 中获取这些,但只要 REST 调用可以做到这一点,我就可以了。

请记住,我确实想要我拥有的所有存储库中的所有 PR。在此之后,我还希望获得所有要求我成为审稿人的公开 PR(那些我需要审阅的人)。

【问题讨论】:

    标签: python rest github github-api


    【解决方案1】:

    您可以使用GitHub API /pulls endpoint 获取用户的拉取请求。

    但总之,你可以使用这个网址

    GET /repos/:owner/:repo/pulls?head=user:{USERNAME-HERE}
    

    对于私有存储库,您需要先进行身份验证。 https://developer.github.com/v3/#authentication

    最后,要列出您作为审阅者的所有拉取请求,请查看this。无法直接列出所有等待您审核的拉取请求,但首先,您可以列出所有拉取请求,然后过滤它们。

    GET /repos/:owner/:repo/pulls/:pull_number/requested_reviewers

    【讨论】:

      猜你喜欢
      • 2012-01-17
      • 2012-09-22
      • 1970-01-01
      • 1970-01-01
      • 2020-01-09
      • 2019-08-28
      • 2021-07-20
      • 1970-01-01
      • 2022-11-03
      相关资源
      最近更新 更多