如何使用Github API与所有者获取拉取请求过滤器

问题描述 投票:5回答:1

我只想从特定用户查询PR。

我需要使用head参数吗?但是如何?

https://api.github.com/repos/org-a/repo-b/pulls?state=open&per_page=1&head=owner:user-c不起作用。

API参考:https://developer.github.com/v3/pulls/#list-pull-requests

github-api pull-request
1个回答
10
投票

使用搜索API并指定repo:REPOauthor:USERis:pr过滤器:

https://developer.github.com/v3/search/#search-issues-and-pull-requests

例如,这是来自rails/rails的来自aderyabin的拉取请求:

https://api.github.com/search/issues?q=is:pr+repo:rails/rails+author:aderyabin

© www.soinside.com 2019 - 2024. All rights reserved.