| title | Pull Request Comments | GitHub API |
|---|
- TOC {:toc}
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).
Pull Request Review Comments leverage these custom mime types. You can read more about the use of mime types in the API here.
GET /repos/:owner/:repo/pulls/:number/comments
<%= headers 200 %> <%= json(:pull_comment) { |h| [h] } %>
GET /repos/:owner/:repo/pulls/comments/:number
<%= headers 200 %> <%= json :pull_comment %>
POST /repos/:owner/:repo/pulls/:number/comments
body : Required string
commit_id : Required string - Sha of the commit to comment on.
path : Required string - Relative path of the file to comment on.
position : Required number - Line index in the diff to comment on.
<%= json
:body => 'Nice change',
:commit_id => '6dcb09b5b57875f334f61aebed695e2e4193db5e',
:path => 'file1.txt',
:position => 4
%>
Instead of passing commit_id, path, and position you can reply to
an existing Pull Request Comment like this:
body : Required string
in_reply_to : Required number - Comment id to reply to.
<%= json
:body => 'Nice change',
:in_reply_to => 4
%>
<%= headers 201, :Location => "https://api.github.com/repos/:owner/:repo/pulls/comments/1" %> <%= json :pull_comment %>
PATCH /repos/:owner/:repo/pulls/comments/:number
body : Required string
<%= json
:body => 'Nice change'
%>
<%= headers 200 %> <%= json :pull_comment %>
DELETE /repos/:owner/:repo/pulls/comments/:number
<%= headers 204 %>
These are the supported mime types for pull request comments. You can read more about the use of mime types in the API here.
application/vnd.github.VERSION.raw+json
application/vnd.github.VERSION.text+json
application/vnd.github.VERSION.html+json
application/vnd.github.VERSION.full+json