2017-05-24 118 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 },