Skip to main content

runs

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

Overview

Nameruns
TypeResource
Idgithub.checks.runs

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)The id of the check.
namestringThe name of the check. (example: test-coverage)
external_idstring (example: 42)
node_idstring (example: MDg6Q2hlY2tSdW40)
appobjectGitHub 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)
check_suiteobject
completed_atstring (date-time) (example: 2018-05-04T01:14:52Z)
conclusionstring (success, failure, neutral, cancelled, skipped, timed_out, action_required) (example: neutral)
deploymentobjectA deployment created as the result of an Actions check run from a workflow that references an environment (title: Deployment)
details_urlstring (example: https://example.com)
head_shastringThe SHA of the commit that is being checked. (example: 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d)
html_urlstring (example: https://github.com/github/hello-world/runs/4)
outputobject
pull_requestsarrayPull requests that are open with a head_sha or head_branch that matches the check. The returned pull requests do not necessarily indicate pull requests that triggered the check.
started_atstring (date-time) (example: 2018-05-04T01:14:52Z)
statusstringThe phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs. (queued, in_progress, completed, waiting, requested, pending) (example: queued)
urlstring (example: https://api.github.com/repos/github/hello-world/check-runs/4)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectowner, repo, check_run_idGets a single check run using its id.

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.
list_for_suiteselectowner, repo, check_suite_idcheck_name, status, filter, per_page, pageLists check runs for a check suite using its id.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.
list_for_refselectowner, repo, refcheck_name, status, filter, per_page, page, app_idLists check runs for a commit ref. The ref can be a SHA, branch name, or a tag name.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the List check suites for a Git reference endpoint and provide the check_suite_id parameter to the List check runs in a check suite endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.
createinsertowner, repo, name, head_sha, status, conclusionCreates a new check run for a specific commit in a repository.

To create a check run, you must use a GitHub App. OAuth apps and authenticated users are not able to create a check suite.

In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.
updateupdateowner, repo, check_run_id, conclusionUpdates a check run for a specific commit in a repository.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

OAuth apps and personal access tokens (classic) cannot use this endpoint.
rerequest_runexecowner, repo, check_run_idTriggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the check_run webhook event with the action rerequested. When a check run is rerequested, the status of the check suite it belongs to is reset to queued and the conclusion is cleared. The check run itself is not updated. GitHub apps recieving the check_run webhook with the rerequested action should then decide if the check run should be reset or updated and call the update check_run endpoint to update the check_run if desired.

For more information about how to re-run GitHub Actions jobs, see "Re-run a job from a workflow run".

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
check_run_idintegerThe unique identifier of the check run.
check_suite_idintegerThe unique identifier of the check suite.
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.
app_idinteger
check_namestringReturns check runs with the specified name.
filterstringFilters check runs by their completed_at timestamp. latest returns the most recent check runs.
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."
statusstringReturns check runs with the specified status.

SELECT examples

Gets a single check run using its id.

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.

SELECT
id,
name,
external_id,
node_id,
app,
check_suite,
completed_at,
conclusion,
deployment,
details_url,
head_sha,
html_url,
output,
pull_requests,
started_at,
status,
url
FROM github.checks.runs
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND check_run_id = '{{ check_run_id }}' -- required
;

INSERT examples

Creates a new check run for a specific commit in a repository.

To create a check run, you must use a GitHub App. OAuth apps and authenticated users are not able to create a check suite.

In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

INSERT INTO github.checks.runs (
name,
head_sha,
details_url,
external_id,
status,
started_at,
conclusion,
completed_at,
output,
actions,
owner,
repo
)
SELECT
'{{ name }}' /* required */,
'{{ head_sha }}' /* required */,
'{{ details_url }}',
'{{ external_id }}',
'{{ status }}' /* required */,
'{{ started_at }}',
'{{ conclusion }}' /* required */,
'{{ completed_at }}',
'{{ output }}',
'{{ actions }}',
'{{ owner }}',
'{{ repo }}'
RETURNING
id,
name,
external_id,
node_id,
app,
check_suite,
completed_at,
conclusion,
deployment,
details_url,
head_sha,
html_url,
output,
pull_requests,
started_at,
status,
url
;

UPDATE examples

Updates a check run for a specific commit in a repository.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

OAuth apps and personal access tokens (classic) cannot use this endpoint.

UPDATE github.checks.runs
SET
name = '{{ name }}',
details_url = '{{ details_url }}',
external_id = '{{ external_id }}',
started_at = '{{ started_at }}',
status = '{{ status }}',
conclusion = '{{ conclusion }}',
completed_at = '{{ completed_at }}',
output = '{{ output }}',
actions = '{{ actions }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND check_run_id = '{{ check_run_id }}' --required
AND conclusion = '{{ conclusion }}' --required
RETURNING
id,
name,
external_id,
node_id,
app,
check_suite,
completed_at,
conclusion,
deployment,
details_url,
head_sha,
html_url,
output,
pull_requests,
started_at,
status,
url;

Lifecycle Methods

Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the check_run webhook event with the action rerequested. When a check run is rerequested, the status of the check suite it belongs to is reset to queued and the conclusion is cleared. The check run itself is not updated. GitHub apps recieving the check_run webhook with the rerequested action should then decide if the check run should be reset or updated and call the update check_run endpoint to update the check_run if desired.

For more information about how to re-run GitHub Actions jobs, see "Re-run a job from a workflow run".

EXEC github.checks.runs.rerequest_run 
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@check_run_id='{{ check_run_id }}' --required
;