在 github 网站上,很多问题都与拉取请求或提交相关联(引用)。有没有办法可以在 github 存档数据库或 github API 中找到连接?
问问题
116 次
2 回答
1
无法请求通过编号链接的问题或提交。我猜想当提交消息类似于“Fixes #13”并给你提交和问题时,你想向你展示一些东西。这是不可能的。据我所知(并且当前记录了 API),如果不自己解析提交消息和问题/问题评论体,这是不可能的。在大多数情况下,这将是相当详尽且完全不可靠的。尽管源代码在 GitHub 上,但其中一些可能不会引用 GitHub 问题。
你总是可以通过联系GitHub来查看他们是否会接受请求
于 2013-04-27T15:09:53.327 回答
0
When you are querying a pull request through the GitHub V3 Pull Request API, you do see a reference to an issue, and a commit:
GET /repos/:owner/:repo/pulls/:number
Response
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/octocat/Hello-World/pulls/1",
"html_url": "https://github.com/octocat/Hello-World/pulls/1",
"diff_url": "https://github.com/octocat/Hello-World/pulls/1.diff",
"patch_url": "https://github.com/octocat/Hello-World/pulls/1.patch",
"issue_url": "https://github.com/octocat/Hello-World/issue/1",
"number": 1,
"state": "open",
"title": "new-feature",
"body": "Please pull these awesome changes",
"created_at": "2011-01-26T19:01:12Z",
"updated_at": "2011-01-26T19:01:12Z",
"closed_at": "2011-01-26T19:01:12Z",
"merged_at": "2011-01-26T19:01:12Z",
"head": {
"label": "new-topic",
"ref": "new-topic",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
...
That is one way to get the association you are after, from a given pull request.
于 2013-04-26T23:20:56.000 回答