2017-05-24 57 views

回答

2

您可以get a single PR并检查它的statemerged属性。如果合并,那么已被接受。如果它关闭并且未合并,则可能是被拒绝

事实上它可能不是拒绝但由创作者关闭。我不确定是否有可能检查它是否被其他用户关闭(拒绝)或其创建者(被拒绝)。

+0

但它确实提供了一个'state',这只能是'open'或'closed'。不接受或拒绝或其中的任何内容。/e:刚刚看到你的编辑,这将是一个很好的方法,看看它被接受或拒绝。 – nbokmans

+0

@nbokmans我已经更新了答案。谢谢你指出! – Kolyunya

+0

@nbokmans - 感谢您的快速输入。有没有可能通过评论来说明这一点?链接https://help.github.com/articles/approving-a-pull-request-with-required-reviews/显示,使用评论审阅者可以请求更改,这表明PR被拒绝变化。是否有可能在API中得到这个? – Gowtham

0

在官方的Github API Documentation中,它显示有一个GET请求,如果它已经被合并,你可以创建包含字段merged_at的GET请求。编辑:theres也是一个合并的领域。

段: ... "merge_commit_sha": "e5bd3914e2e596debea16f433f57875b5b90bcd6", "merged": false, "mergeable": true, "merged_by": { "login": "octocat", "id": 1, "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false },