comments
Creates, updates, deletes, gets or lists a comments resource.
Overview
| Name | comments |
| Type | Resource |
| Id | github.repos.comments |
Fields
The following fields are returned by SELECT queries:
- get_commit_comment
- list_comments_for_commit
- list_commit_comments_for_repo
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
commit_id | string | |
node_id | string | |
author_association | string | How the author is associated with the repository. (COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER) (title: author_association, example: OWNER) |
body | string | |
created_at | string (date-time) | |
html_url | string (uri) | |
line | integer | |
path | string | |
position | integer | |
reactions | object | (title: Reaction Rollup) |
updated_at | string (date-time) | |
url | string (uri) | |
user | object | A GitHub user. (title: Simple User) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
commit_id | string | |
node_id | string | |
author_association | string | How the author is associated with the repository. (COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER) (title: author_association, example: OWNER) |
body | string | |
created_at | string (date-time) | |
html_url | string (uri) | |
line | integer | |
path | string | |
position | integer | |
reactions | object | (title: Reaction Rollup) |
updated_at | string (date-time) | |
url | string (uri) | |
user | object | A GitHub user. (title: Simple User) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
commit_id | string | |
node_id | string | |
author_association | string | How the author is associated with the repository. (COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER) (title: author_association, example: OWNER) |
body | string | |
created_at | string (date-time) | |
html_url | string (uri) | |
line | integer | |
path | string | |
position | integer | |
reactions | object | (title: Reaction Rollup) |
updated_at | string (date-time) | |
url | string (uri) | |
user | object | A GitHub user. (title: Simple User) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_commit_comment | select | owner, repo, comment_id | Gets a specified commit comment. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.- application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. | |
list_comments_for_commit | select | owner, repo, commit_sha | per_page, page | Lists the comments for a specified commit. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.- application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. |
list_commit_comments_for_repo | select | owner, repo | per_page, page | Lists the commit comments for a specified repository. Comments are ordered by ascending ID. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.- application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. |
create_commit_comment | insert | owner, repo, commit_sha, body | Create a comment for a commit using its :commit_sha.This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best practices for using the REST API." This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.- application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. | |
update_commit_comment | update | owner, repo, comment_id, body | Updates the contents of a specified commit comment. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.- application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. | |
delete_commit_comment | delete | owner, repo, comment_id |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
comment_id | integer (int64) | The unique identifier of the comment. |
commit_sha | string | The SHA of the commit. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- get_commit_comment
- list_comments_for_commit
- list_commit_comments_for_repo
Gets a specified commit comment.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
- application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
SELECT
id,
commit_id,
node_id,
author_association,
body,
created_at,
html_url,
line,
path,
position,
reactions,
updated_at,
url,
user
FROM github.repos.comments
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND comment_id = '{{ comment_id }}' -- required
;
Lists the comments for a specified commit.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
- application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
SELECT
id,
commit_id,
node_id,
author_association,
body,
created_at,
html_url,
line,
path,
position,
reactions,
updated_at,
url,
user
FROM github.repos.comments
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND commit_sha = '{{ commit_sha }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
Lists the commit comments for a specified repository. Comments are ordered by ascending ID.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
- application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
SELECT
id,
commit_id,
node_id,
author_association,
body,
created_at,
html_url,
line,
path,
position,
reactions,
updated_at,
url,
user
FROM github.repos.comments
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- create_commit_comment
- Manifest
Create a comment for a commit using its :commit_sha.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best practices for using the REST API."
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
- application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
INSERT INTO github.repos.comments (
body,
path,
position,
line,
owner,
repo,
commit_sha
)
SELECT
'{{ body }}' /* required */,
'{{ path }}',
{{ position }},
{{ line }},
'{{ owner }}',
'{{ repo }}',
'{{ commit_sha }}'
RETURNING
id,
commit_id,
node_id,
author_association,
body,
created_at,
html_url,
line,
path,
position,
reactions,
updated_at,
url,
user
;
# Description fields are for documentation purposes
- name: comments
props:
- name: owner
value: "{{ owner }}"
description: Required parameter for the comments resource.
- name: repo
value: "{{ repo }}"
description: Required parameter for the comments resource.
- name: commit_sha
value: "{{ commit_sha }}"
description: Required parameter for the comments resource.
- name: body
value: "{{ body }}"
description: |
The contents of the comment.
- name: path
value: "{{ path }}"
description: |
Relative path of the file to comment on.
- name: position
value: {{ position }}
description: |
Line index in the diff to comment on.
- name: line
value: {{ line }}
description: |
**Closing down notice**. Use **position** parameter instead. Line number in the file to comment on.
UPDATE examples
- update_commit_comment
Updates the contents of a specified commit comment.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
- application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
UPDATE github.repos.comments
SET
body = '{{ body }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND comment_id = '{{ comment_id }}' --required
AND body = '{{ body }}' --required
RETURNING
id,
commit_id,
node_id,
author_association,
body,
created_at,
html_url,
line,
path,
position,
reactions,
updated_at,
url,
user;
DELETE examples
- delete_commit_comment
No description available.
DELETE FROM github.repos.comments
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND comment_id = '{{ comment_id }}' --required
;