gpt4 book ai didi

curl - 从 GitHub 拉取请求中获取评论列表

转载 作者:行者123 更新时间:2023-12-04 22:47:56 25 4
gpt4 key购买 nike

根据 http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request

我应该能够通过发出以下 curl 语句来获得评论列表,但是,它返回空,好像没有评论,有什么想法为什么?或者我怎样才能让它发挥作用?

curl "https://api.github.com/repos/37signals/sub/pulls/37/comments" -v

谢谢!

最佳答案

注意 Pull requests API docs 顶部附近的文本(根据TOC):

The Pull Request API allows you to list, view, edit, create, and even merge pull requests. Comments on pull requests can be managed via the Issue Comments API.



因此,API 端点 you are currently using用于拉取请求审查评论,而不是普通的拉取请求评论:

Pull Request Review Comments are comments on a portion of the unified diff. These are separate from Commit Comments (which are applied directly to a commit, outside of the Pull Request view), and Issue Comments (which do not reference a portion of the unified diff).



由于您引用的拉取请求没有任何审查意见,您将获得正确的结果(一个空列表)。但是,正如我上面提到的,您应该点击的 API 端点是问题评论的端点(只需使用相同的拉取请求 ID,因为它等于问题 ID):
curl "https://api.github.com/repos/37signals/sub/issues/37/comments" -v

关于curl - 从 GitHub 拉取请求中获取评论列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16198351/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com