| title | Repo Comments | GitHub API |
|---|
- TOC {:toc}
Commit Comments leverage these custom mime types. You can read more about the use of mime types in the API here.
Comments are ordered by ascending ID.
GET /repos/:owner/:repo/comments
<%= headers 200 %> <%= json(:commit_comment) { |h| [h] } %>
GET /repos/:owner/:repo/commits/:sha/comments
<%= headers 200 %> <%= json(:commit_comment) { |h| [h] } %>
POST /repos/:owner/:repo/commits/:sha/comments
body : Required string
path : Optional string - Relative path of the file to comment on.
position : Optional number - Line index in the diff to comment on.
line : Optional number - Line number in the file to comment on. Defaults to 1.
<%= json
:body => 'Nice change',
:commit_id => '6dcb09b5b57875f334f61aebed695e2e4193db5e',
:line => 1,
:path => 'file1.txt',
:position => 4
%>
<%= headers 201, :Location => "https://api.github.com/user/repo/comments/1" %> <%= json :commit_comment %>
GET /repos/:owner/:repo/comments/:id
<%= headers 200 %> <%= json :commit_comment %>
PATCH /repos/:owner/:repo/comments/:id
body : Required string
<%= json
:body => 'Nice change'
%>
<%= headers 200 %> <%= json :commit_comment %>
DELETE /repos/:owner/:repo/comments/:id
<%= headers 204 %>
These are the supported mime types for commit comments. You can read more about the use of mime types in the API here.
application/vnd.github-commitcomment.raw+json
application/vnd.github-commitcomment.text+json
application/vnd.github-commitcomment.html+json
application/vnd.github-commitcomment.full+json