使用 github_api gem 列出回购的所有问题
List all issues for a repo using github_api gem
我正在为 rails 使用 github_api gem 并且我正在尝试列出我所属组织内特定回购协议的所有问题.
我正在使用
@github = Github.new :oauth_token => 'token',
:org => 'org-name',
:user => 'org-name',
:repo => 'repo-name'
@issues = @github.issues.list state: 'open'
这 returns 只是我被分配到的问题 - 将状态更改为 'closed' returns 什么都没有 - 但我自己使用 curl returns 刺激端点所有问题我在找
有谁知道如何列出与特定回购相关的所有问题 - 而不仅仅是分配给您自己的问题?
在研究了这个 gem 的文档之后 - 我发现您可以点击 github 搜索 api - 允许您搜索 repo 的问题 - 并提供标志过滤结果。
@github = Github.new :oauth_token => 'token',
:org => 'org-name',
:user => 'org-name',
:repo => 'repo-name'
@github.search.issues 'repo:user/repo type:pr state:closed updated:>=2015-10-15'
查看 Github api 文档显示了您可以根据什么来过滤结果。我希望这可以帮助其他遇到此问题的人 gem。
我正在为 rails 使用 github_api gem 并且我正在尝试列出我所属组织内特定回购协议的所有问题.
我正在使用
@github = Github.new :oauth_token => 'token',
:org => 'org-name',
:user => 'org-name',
:repo => 'repo-name'
@issues = @github.issues.list state: 'open'
这 returns 只是我被分配到的问题 - 将状态更改为 'closed' returns 什么都没有 - 但我自己使用 curl returns 刺激端点所有问题我在找
有谁知道如何列出与特定回购相关的所有问题 - 而不仅仅是分配给您自己的问题?
在研究了这个 gem 的文档之后 - 我发现您可以点击 github 搜索 api - 允许您搜索 repo 的问题 - 并提供标志过滤结果。
@github = Github.new :oauth_token => 'token',
:org => 'org-name',
:user => 'org-name',
:repo => 'repo-name'
@github.search.issues 'repo:user/repo type:pr state:closed updated:>=2015-10-15'
查看 Github api 文档显示了您可以根据什么来过滤结果。我希望这可以帮助其他遇到此问题的人 gem。