我想知道Github API中是否有函數返回拉取請求的狀態,不管它被接受還是被拒絕。這樣的功能是否存在?我們如何知道使用github中的API批准或拒絕拉取請求?
回答
您可以get a single PR並檢查它的state
和merged
屬性。如果合併,那麼已被接受。如果它關閉並且未合併,則可能是被拒絕。
事實上它可能不是拒絕但由創作者關閉。我不確定是否有可能檢查它是否被其他用戶關閉(拒絕)或其創建者(被拒絕)。
在官方的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 },
- 1. Github API批准的拉取請求
- 2. 如何使用github api查找批准了請求的用戶?
- 3. 批准/拒絕通過下拉列表
- 4. 如何清理GitHub拉取請求?
- 5. 如何過濾尚未批准的拉取請求
- 6. 拒絕請求
- 7. 放棄Git針對拒絕的拉取請求在Github上提交
- 8. 如何從GitHub拉取請求觸發Jenkins 2.0管道作業
- 9. 在wsgi中拒絕或過濾請求
- 10. API是否應該暴露「批准」或「拒絕」等操作?
- 11. 如何製作簡單的「批准或拒絕」系統
- 12. 處理拒絕/拒絕的請求
- 13. 如何用django過早拒絕請求?
- 14. 如何避免使用API延遲github拉請求合併使用API
- 15. 批准和拒絕的多用戶
- 16. 我該如何刪除版本分支的GitHub拉取請求
- 17. 我們如何知道客戶請求的帖子?
- 18. 從VSTS拉取請求中移除所需的批准者
- 19. Google Places API請求被拒絕
- 20. Google Cloud Vision API'拒絕請求入場'
- 21. Web API拒絕了多部分請求
- 22. 如何在github中討論拉請求
- 23. 如何通過twitter API中的代碼批准後續請求?
- 24. Github:推拉請求
- 25. 如何從github api獲取「我的請求」?
- 26. GitHub Ruby API - 更新拉請求描述
- 27. Heroku拒絕我的git推送請求
- 28. Github日誌提取/拉取請求
- 29. 如何知道何時接受或拒絕了國旗?
- 30. 拒絕直接請求使用.htaccess
但它確實提供了一個'state',這隻能是'open'或'closed'。不接受或拒絕或其中的任何內容。/e:剛剛看到你的編輯,這將是一個很好的方法,看看它被接受或拒絕。 – nbokmans
@nbokmans我已經更新了答案。謝謝你指出! – Kolyunya
@nbokmans - 感謝您的快速輸入。有沒有可能通過評論來說明這一點?鏈接https://help.github.com/articles/approving-a-pull-request-with-required-reviews/顯示,使用評論審閱者可以請求更改,這表明PR被拒絕變化。是否有可能在API中得到這個? – Gowtham