Skip to main content

status_commits

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

Overview

Namestatus_commits
TypeResource
Idgithub.repos.status_commits

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger
node_idstring
avatar_urlstring
contextstring
created_atstring
creatorobjectA GitHub user. (title: Simple User)
descriptionstring
statestring
target_urlstring
updated_atstring
urlstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_commit_statuses_for_refselectowner, repo, refper_page, pageUsers with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.

This resource is also available via a legacy route: GET /repos/:owner/:repo/statuses/:ref.
create_commit_statusinsertowner, repo, sha, stateUsers with push access in a repository can create commit statuses for a given SHA.

Note: there is a limit of 1000 statuses per sha and context within a repository. Attempts to create more than 1000 statuses will result in a validation error.

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
ownerstringThe account owner of the repository. The name is not case sensitive.
refstringThe commit reference. Can be a commit SHA, branch name (heads/BRANCH_NAME), or tag name (tags/TAG_NAME). For more information, see "Git References" in the Git documentation.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
shastring
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

Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.

This resource is also available via a legacy route: GET /repos/:owner/:repo/statuses/:ref.

SELECT
id,
node_id,
avatar_url,
context,
created_at,
creator,
description,
state,
target_url,
updated_at,
url
FROM github.repos.status_commits
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND ref = '{{ ref }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;

INSERT examples

Users with push access in a repository can create commit statuses for a given SHA.

Note: there is a limit of 1000 statuses per sha and context within a repository. Attempts to create more than 1000 statuses will result in a validation error.

INSERT INTO github.repos.status_commits (
state,
target_url,
description,
context,
owner,
repo,
sha
)
SELECT
'{{ state }}' /* required */,
'{{ target_url }}',
'{{ description }}',
'{{ context }}',
'{{ owner }}',
'{{ repo }}',
'{{ sha }}'
RETURNING
id,
node_id,
avatar_url,
context,
created_at,
creator,
description,
state,
target_url,
updated_at,
url
;