comments
Creates, updates, deletes, gets or lists a comments resource.
Overview
| Name | comments |
| Type | Resource |
| Id | github.issues.comments |
Fields
The following fields are returned by SELECT queries:
- get_comment
- list_comments
- list_comments_for_repo
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | Unique identifier of the issue comment |
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 | Contents of the issue comment (example: What version of Safari were you using when you observed this bug?) |
body_html | string | |
body_text | string | |
created_at | string (date-time) | (example: 2011-04-14T16:00:49Z) |
html_url | string (uri) | |
issue_url | string (uri) | |
performed_via_github_app | object | GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. (title: GitHub app) |
pin | object | Context around who pinned an issue comment and when it was pinned. (title: Pinned Issue Comment) |
reactions | object | (title: Reaction Rollup) |
updated_at | string (date-time) | (example: 2011-04-14T16:00:49Z) |
url | string (uri) | URL for the issue comment (example: https://api.github.com/repositories/42/issues/comments/1) |
user | object | A GitHub user. (title: Simple User) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | Unique identifier of the issue comment |
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 | Contents of the issue comment (example: What version of Safari were you using when you observed this bug?) |
body_html | string | |
body_text | string | |
created_at | string (date-time) | (example: 2011-04-14T16:00:49Z) |
html_url | string (uri) | |
issue_url | string (uri) | |
performed_via_github_app | object | GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. (title: GitHub app) |
pin | object | Context around who pinned an issue comment and when it was pinned. (title: Pinned Issue Comment) |
reactions | object | (title: Reaction Rollup) |
updated_at | string (date-time) | (example: 2011-04-14T16:00:49Z) |
url | string (uri) | URL for the issue comment (example: https://api.github.com/repositories/42/issues/comments/1) |
user | object | A GitHub user. (title: Simple User) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | Unique identifier of the issue comment |
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 | Contents of the issue comment (example: What version of Safari were you using when you observed this bug?) |
body_html | string | |
body_text | string | |
created_at | string (date-time) | (example: 2011-04-14T16:00:49Z) |
html_url | string (uri) | |
issue_url | string (uri) | |
performed_via_github_app | object | GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. (title: GitHub app) |
pin | object | Context around who pinned an issue comment and when it was pinned. (title: Pinned Issue Comment) |
reactions | object | (title: Reaction Rollup) |
updated_at | string (date-time) | (example: 2011-04-14T16:00:49Z) |
url | string (uri) | URL for the issue comment (example: https://api.github.com/repositories/42/issues/comments/1) |
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_comment | select | owner, repo, comment_id | You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. | |
list_comments | select | owner, repo, issue_number | since, per_page, page | You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. Issue comments are ordered by ascending ID. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. |
list_comments_for_repo | select | owner, repo | sort, direction, since, per_page, page | You can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request. By default, issue comments are ordered by ascending ID. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. |
create_comment | insert | owner, repo, issue_number, body | You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. 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.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. | |
update_comment | update | owner, repo, comment_id, body | You can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. | |
delete_comment | delete | owner, repo, comment_id | You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. |
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. |
issue_number | integer | The number that identifies the issue. |
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. |
direction | string | Either asc or desc. Ignored without the sort parameter. |
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." |
since | string (date-time) | Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. |
sort | string | The property to sort the results by. |
SELECT examples
- get_comment
- list_comments
- list_comments_for_repo
You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
SELECT
id,
node_id,
author_association,
body,
body_html,
body_text,
created_at,
html_url,
issue_url,
performed_via_github_app,
pin,
reactions,
updated_at,
url,
user
FROM github.issues.comments
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND comment_id = '{{ comment_id }}' -- required
;
You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
Issue comments are ordered by ascending ID.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
SELECT
id,
node_id,
author_association,
body,
body_html,
body_text,
created_at,
html_url,
issue_url,
performed_via_github_app,
pin,
reactions,
updated_at,
url,
user
FROM github.issues.comments
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND issue_number = '{{ issue_number }}' -- required
AND since = '{{ since }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
You can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.
By default, issue comments are ordered by ascending ID.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
SELECT
id,
node_id,
author_association,
body,
body_html,
body_text,
created_at,
html_url,
issue_url,
performed_via_github_app,
pin,
reactions,
updated_at,
url,
user
FROM github.issues.comments
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND sort = '{{ sort }}'
AND direction = '{{ direction }}'
AND since = '{{ since }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- create_comment
- Manifest
You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
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.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
INSERT INTO github.issues.comments (
body,
owner,
repo,
issue_number
)
SELECT
'{{ body }}' /* required */,
'{{ owner }}',
'{{ repo }}',
'{{ issue_number }}'
RETURNING
id,
node_id,
author_association,
body,
body_html,
body_text,
created_at,
html_url,
issue_url,
performed_via_github_app,
pin,
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: issue_number
value: {{ issue_number }}
description: Required parameter for the comments resource.
- name: body
value: "{{ body }}"
description: |
The contents of the comment.
UPDATE examples
- update_comment
You can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.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.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
UPDATE github.issues.comments
SET
body = '{{ body }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND comment_id = '{{ comment_id }}' --required
AND body = '{{ body }}' --required
RETURNING
id,
node_id,
author_association,
body,
body_html,
body_text,
created_at,
html_url,
issue_url,
performed_via_github_app,
pin,
reactions,
updated_at,
url,
user;
DELETE examples
- delete_comment
You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
DELETE FROM github.issues.comments
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND comment_id = '{{ comment_id }}' --required
;