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.
Creates a new check run for a specific commit in a repository. Your GitHub App must have the checks:write
permission to create check runs.
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.
octokit.checks.create({owner,repo,name,head_sha,output.title,output.summary,output.annotations[].path,output.annotations[].start_line,output.annotations[].end_line,output.annotations[].annotation_level,output.annotations[].message,output.images[].alt,output.images[].image_url,actions[].label,actions[].description,actions[].identifier})
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
name | yes | The name of the check. For example, "code-coverage". |
head_sha | yes | The SHA of the commit. |
details_url | no | The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used. |
external_id | no | A reference for the run on the integrator's system. |
status | no | The current status. Can be one of |
started_at | no | The time that the check run began. This is a timestamp in ISO 8601 format: |
conclusion | no | Required if you provide |
completed_at | no | The time the check completed. This is a timestamp in ISO 8601 format: |
output | no | Check runs can accept a variety of data in the |
output.title | yes | The title of the check run. |
output.summary | yes | The summary of the check run. This parameter supports Markdown. |
output.text | no | The details of the check run. This parameter supports Markdown. |
output.annotations | no | Adds information from your analysis to specific lines of code. Annotations are visible on GitHub in the Checks and Files changed tab of the pull request. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the Update a check run endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about how you can view annotations on GitHub, see "About status checks". See the |
output.annotations[].path | yes | The path of the file to add an annotation to. For example, |
output.annotations[].start_line | yes | The start line of the annotation. |
output.annotations[].end_line | yes | The end line of the annotation. |
output.annotations[].start_column | no | The start column of the annotation. Annotations only support |
output.annotations[].end_column | no | The end column of the annotation. Annotations only support |
output.annotations[].annotation_level | yes | The level of the annotation. Can be one of |
output.annotations[].message | yes | A short description of the feedback for these lines of code. The maximum size is 64 KB. |
output.annotations[].title | no | The title that represents the annotation. The maximum size is 255 characters. |
output.annotations[].raw_details | no | Details about this annotation. The maximum size is 64 KB. |
output.images | no | Adds images to the output displayed in the GitHub pull request UI. See the |
output.images[].alt | yes | The alternative text for the image. |
output.images[].image_url | yes | The full URL of the image. |
output.images[].caption | no | A short image description. |
actions | no | Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the |
actions[].label | yes | The text to be displayed on a button in the web UI. The maximum size is 20 characters. |
actions[].description | yes | A short explanation of what this action would do. The maximum size is 40 characters. |
actions[].identifier | yes | A reference for the action on the integrator's system. The maximum size is 20 characters. |
See also: GitHub Developer Guide documentation.
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
.
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". Your GitHub App must have the checks:write
permission to create check suites.
octokit.checks.createSuite({owner,repo,head_sha,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
head_sha | yes | The sha of the head commit. |
See also: GitHub Developer Guide documentation.
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.
Gets a single check run using its id
. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the repo
scope to get check runs in a private repository.
octokit.checks.get({owner,repo,check_run_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
check_run_id | yes | check_run_id parameter |
See also: GitHub Developer Guide documentation.
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
.
Gets a single check suite using its id
. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the repo
scope to get check suites in a private repository.
octokit.checks.getSuite({owner,repo,check_suite_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
check_suite_id | yes | check_suite_id parameter |
See also: GitHub Developer Guide documentation.
Lists annotations for a check run using the annotation id
. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the repo
scope to get annotations for a check run in a private repository.
octokit.checks.listAnnotations({owner,repo,check_run_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
check_run_id | yes | check_run_id parameter |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
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.
Lists check runs for a commit ref. The ref
can be a SHA, branch name, or a tag name. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the repo
scope to get check runs in a private repository.
octokit.checks.listForRef({owner,repo,ref,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
ref | yes | ref+ parameter |
check_name | no | Returns check runs with the specified |
status | no | Returns check runs with the specified |
filter | no | Filters check runs by their |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
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.
Lists check runs for a check suite using its id
. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the repo
scope to get check runs in a private repository.
octokit.checks.listForSuite({owner,repo,check_suite_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
check_suite_id | yes | check_suite_id parameter |
check_name | no | Returns check runs with the specified |
status | no | Returns check runs with the specified |
filter | no | Filters check runs by their |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
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
.
Lists check suites for a commit ref
. The ref
can be a SHA, branch name, or a tag name. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the repo
scope to get check suites in a private repository.
octokit.checks.listSuitesForRef({owner,repo,ref,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
ref | yes | ref+ parameter |
app_id | no | Filters check suites by GitHub App |
check_name | no | Returns check runs with the specified |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
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.
To rerequest a check suite, your GitHub App must have the checks:read
permission on a private repository or pull access to a public repository.
octokit.checks.rerequestSuite({owner,repo,check_suite_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
check_suite_id | yes | check_suite_id parameter |
See also: GitHub Developer Guide documentation.
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.
octokit.checks.setSuitesPreferences({owner,repo,auto_trigger_checks[].app_id,auto_trigger_checks[].setting})
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
auto_trigger_checks | no | Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. See the |
auto_trigger_checks[].app_id | yes | The |
auto_trigger_checks[].setting | yes | Set to |
See also: GitHub Developer Guide documentation.
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.
Updates a check run for a specific commit in a repository. Your GitHub App must have the checks:write
permission to edit check runs.
octokit.checks.update({owner,repo,check_run_id,output.summary,output.annotations[].path,output.annotations[].start_line,output.annotations[].end_line,output.annotations[].annotation_level,output.annotations[].message,output.images[].alt,output.images[].image_url,actions[].label,actions[].description,actions[].identifier})
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
check_run_id | yes | check_run_id parameter |
name | no | The name of the check. For example, "code-coverage". |
details_url | no | The URL of the integrator's site that has the full details of the check. |
external_id | no | A reference for the run on the integrator's system. |
started_at | no | This is a timestamp in ISO 8601 format: |
status | no | The current status. Can be one of |
conclusion | no | Required if you provide |
completed_at | no | The time the check completed. This is a timestamp in ISO 8601 format: |
output | no | Check runs can accept a variety of data in the |
output.title | no | Required. |
output.summary | yes | Can contain Markdown. |
output.text | no | Can contain Markdown. |
output.annotations | no | Adds information from your analysis to specific lines of code. Annotations are visible in GitHub's pull request UI. Annotations are visible in GitHub's pull request UI. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the Update a check run endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about annotations in the UI, see "About status checks". See the |
output.annotations[].path | yes | The path of the file to add an annotation to. For example, |
output.annotations[].start_line | yes | The start line of the annotation. |
output.annotations[].end_line | yes | The end line of the annotation. |
output.annotations[].start_column | no | The start column of the annotation. Annotations only support |
output.annotations[].end_column | no | The end column of the annotation. Annotations only support |
output.annotations[].annotation_level | yes | The level of the annotation. Can be one of |
output.annotations[].message | yes | A short description of the feedback for these lines of code. The maximum size is 64 KB. |
output.annotations[].title | no | The title that represents the annotation. The maximum size is 255 characters. |
output.annotations[].raw_details | no | Details about this annotation. The maximum size is 64 KB. |
output.images | no | Adds images to the output displayed in the GitHub pull request UI. See the |
output.images[].alt | yes | The alternative text for the image. |
output.images[].image_url | yes | The full URL of the image. |
output.images[].caption | no | A short image description. |
actions | no | Possible further actions the integrator can perform, which a user may trigger. Each action includes a |
actions[].label | yes | The text to be displayed on a button in the web UI. The maximum size is 20 characters. |
actions[].description | yes | A short explanation of what this action would do. The maximum size is 40 characters. |
actions[].identifier | yes | A reference for the action on the integrator's system. The maximum size is 20 characters. |
See also: GitHub Developer Guide documentation.