Skip to main content

suites

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

Overview

Namesuites
TypeResource
Idgithub.checks.suites

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)
node_idstring (example: MDEwOkNoZWNrU3VpdGU1)
afterstring (example: d6fde92930d4715a2b49857d24b940956b26d2d3)
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)
beforestring (example: 146e867f55c26428e5f9fade55a9bbf5e95a7912)
check_runs_urlstring
conclusionstring (success, failure, neutral, cancelled, skipped, timed_out, action_required, startup_failure, stale, ) (example: neutral)
created_atstring (date-time)
head_branchstring (example: master)
head_commitobjectA commit. (title: Simple Commit)
head_shastringThe SHA of the head commit that is being checked. (example: 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d)
latest_check_runs_countinteger
pull_requestsarray
repositoryobjectMinimal Repository (title: Minimal Repository)
rerequestableboolean
runs_rerequestableboolean
statusstringThe phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites. (queued, in_progress, completed, waiting, requested, pending) (example: completed)
updated_atstring (date-time)
urlstring (example: https://api.github.com/repos/github/hello-world/check-suites/5)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_suiteselectowner, repo, check_suite_idGets a single check suite 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 and a null value for head_branch.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.
list_suites_for_refselectowner, repo, refapp_id, check_name, per_page, pageLists check suites 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 and a null value for head_branch.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.
create_suiteinsertowner, repo, head_shaCreates a check suite manually. By default, check suites are automatically created when you create a check run. You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "Update repository preferences for check suites".

> [!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 and a null value for head_branch.

OAuth apps and personal access tokens (classic) cannot use this endpoint.
set_suites_preferencesupdateowner, repoChanges the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually Create a check suite.
You must have admin permissions in the repository to set preferences for check suites.
rerequest_suiteexecowner, repo, check_suite_idTriggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the check_suite webhook event with the action rerequested. When a check suite is rerequested, its status is reset to queued and the conclusion is cleared.

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_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_idintegerFilters check suites by GitHub App id. (example: 1)
check_namestringReturns check runs with the specified name.
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

Gets a single check suite 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 and a null value for head_branch.

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

SELECT
id,
node_id,
after,
app,
before,
check_runs_url,
conclusion,
created_at,
head_branch,
head_commit,
head_sha,
latest_check_runs_count,
pull_requests,
repository,
rerequestable,
runs_rerequestable,
status,
updated_at,
url
FROM github.checks.suites
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND check_suite_id = '{{ check_suite_id }}' -- required
;

INSERT examples

Creates a check suite manually. By default, check suites are automatically created when you create a check run. You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "Update repository preferences for check suites".

> [!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 and a null value for head_branch.

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

INSERT INTO github.checks.suites (
head_sha,
owner,
repo
)
SELECT
'{{ head_sha }}' /* required */,
'{{ owner }}',
'{{ repo }}'
RETURNING
id,
node_id,
after,
app,
before,
check_runs_url,
conclusion,
created_at,
head_branch,
head_commit,
head_sha,
latest_check_runs_count,
pull_requests,
repository,
rerequestable,
runs_rerequestable,
status,
updated_at,
url
;

UPDATE examples

Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually Create a check suite.
You must have admin permissions in the repository to set preferences for check suites.

UPDATE github.checks.suites
SET
auto_trigger_checks = '{{ auto_trigger_checks }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
RETURNING
preferences,
repository;

Lifecycle Methods

Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the check_suite webhook event with the action rerequested. When a check suite is rerequested, its status is reset to queued and the conclusion is cleared.

EXEC github.checks.suites.rerequest_suite 
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@check_suite_id='{{ check_suite_id }}' --required
;