Skip to main content

commit_comments

Creates, updates, deletes, gets or lists a commit_comments resource.

Overview

Namecommit_comments
TypeResource
Idgithub.reactions.commit_comments

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger
node_idstring (example: MDg6UmVhY3Rpb24x)
contentstringThe reaction to use (+1, -1, laugh, confused, heart, hooray, rocket, eyes) (example: heart)
created_atstring (date-time) (example: 2016-05-20T20:09:31Z)
userobjectA GitHub user. (title: Simple User)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_for_commit_commentselectowner, repo, comment_idcontent, per_page, pageList the reactions to a commit comment.
create_for_commit_commentinsertowner, repo, comment_id, contentCreate a reaction to a commit comment. A response with an HTTP 200 status means that you already added the reaction type to this commit comment.
delete_for_commit_commentdeleteowner, repo, comment_id, reaction_id> [!NOTE]
> You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id.

Delete a reaction to a commit comment.

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.

NameDatatypeDescription
comment_idinteger (int64)The unique identifier of the comment.
ownerstringThe account owner of the repository. The name is not case sensitive.
reaction_idintegerThe unique identifier of the reaction.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
contentstringReturns a single reaction type. Omit this parameter to list all reactions to a commit comment.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

List the reactions to a commit comment.

SELECT
id,
node_id,
content,
created_at,
user
FROM github.reactions.commit_comments
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND comment_id = '{{ comment_id }}' -- required
AND content = '{{ content }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;

INSERT examples

Create a reaction to a commit comment. A response with an HTTP 200 status means that you already added the reaction type to this commit comment.

INSERT INTO github.reactions.commit_comments (
content,
owner,
repo,
comment_id
)
SELECT
'{{ content }}' /* required */,
'{{ owner }}',
'{{ repo }}',
'{{ comment_id }}'
RETURNING
id,
node_id,
content,
created_at,
user
;

DELETE examples

> [!NOTE]
> You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id.

Delete a reaction to a commit comment.

DELETE FROM github.reactions.commit_comments
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND comment_id = '{{ comment_id }}' --required
AND reaction_id = '{{ reaction_id }}' --required
;