我想知道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拉取请求?
- 2. 如何过滤尚未批准的拉取请求
- 3. 拒绝请求
- 4. 放弃Git针对拒绝的拉取请求在Github上提交
- 5. 如何从GitHub拉取请求触发Jenkins 2.0管道作业
- 6. 在wsgi中拒绝或过滤请求
- 7. API是否应该暴露“批准”或“拒绝”等操作?
- 8. 如何制作简单的“批准或拒绝”系统
- 9. 如何用django过早拒绝请求?
- 10. 批准和拒绝的多用户
- 11. 我们如何知道客户请求的帖子?
- 12. Google Cloud Vision API'拒绝请求入场'
- 13. 如何在github中讨论拉请求
- 14. Github:推拉请求
- 15. 如何通过twitter API中的代码批准后续请求?
- 16. GitHub Ruby API - 更新拉请求描述
- 17. 拒绝直接请求使用.htaccess
- 18. 如何performantely拒绝点大的请求(基于PHP API)
- 19. 如何使用python httplib或urllib2做Google API批量请求?
- 20. 如何拒绝恶意请求
- 21. Youtube数据API拒绝我的服务器端请求
- 22. Drive API v2&v3(1.16)使用批量请求时文件监视请求被拒绝
- 23. 如何知道我的HTTP请求是否使用UTF-8?
- 24. laravel批准和拒登用户作为管理员的请求
- 25. 合并拉取请求 - 我如何知道它合并成什么?
- 26. 试图批准,拒绝或删除多个用户
- 27. GitHub:如何重新打开拉请求
- 28. IdentityServer3 .Net Web API。获取错误 - 授权已拒绝此请求
- 29. 科斯请求被拒绝
- 30. Ajax请求被拒绝
但它确实提供了一个'state',这只能是'open'或'closed'。不接受或拒绝或其中的任何内容。/e:刚刚看到你的编辑,这将是一个很好的方法,看看它被接受或拒绝。 – nbokmans
@nbokmans我已经更新了答案。谢谢你指出! – Kolyunya
@nbokmans - 感谢您的快速输入。有没有可能通过评论来说明这一点?链接https://help.github.com/articles/approving-a-pull-request-with-required-reviews/显示,使用评论审阅者可以请求更改,这表明PR被拒绝变化。是否有可能在API中得到这个? – Gowtham