POST /repos/{owner}/{repo}/check-runs

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.

Servers

Path parameters

Name Type Required Description
repo String Yes

The name of the repository without the .git extension. The name is not case sensitive.

owner String Yes

The account owner of the repository. The name is not case sensitive.

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
head_sha String Yes

The SHA of the commit.

external_id String No

A reference for the run on the integrator's system.

actions[] Array 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 check_run.requested_action webhook to your app. Each action includes a label, identifier and description. A maximum of three actions are accepted. To learn more about check runs and requested actions, see "Check runs and requested actions."

actions[].description String Yes

A short explanation of what this action would do. The maximum size is 40 characters.

actions[].label String Yes

The text to be displayed on a button in the web UI. The maximum size is 20 characters.

actions[].identifier String Yes

A reference for the action on the integrator's system. The maximum size is 20 characters.

name String Yes

The name of the check. For example, "code-coverage".

output Object No

Check runs can accept a variety of data in the output object, including a title and summary and can optionally provide descriptive details about the run.

output.text String No

The details of the check run. This parameter supports Markdown. Maximum length: 65535 characters.

output.annotations[] Array 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. GitHub Actions are limited to 10 warning annotations and 10 error annotations per step. For details about how you can view annotations on GitHub, see "About status checks".

output.annotations[].raw_details String No

Details about this annotation. The maximum size is 64 KB.

output.annotations[].message String Yes

A short description of the feedback for these lines of code. The maximum size is 64 KB.

output.annotations[].title String No

The title that represents the annotation. The maximum size is 255 characters.

output.annotations[].start_column Integer No

The start column of the annotation. Annotations only support start_column and end_column on the same line. Omit this parameter if start_line and end_line have different values. Column numbers start at 1.

output.annotations[].end_column Integer No

The end column of the annotation. Annotations only support start_column and end_column on the same line. Omit this parameter if start_line and end_line have different values.

output.annotations[].end_line Integer Yes

The end line of the annotation.

output.annotations[].path String Yes

The path of the file to add an annotation to. For example, assets/css/main.css.

output.annotations[].start_line Integer Yes

The start line of the annotation. Line numbers start at 1.

output.annotations[].annotation_level String Yes

The level of the annotation.

Possible values:

  • "failure"
  • "notice"
  • "warning"
output.images[] Array No

Adds images to the output displayed in the GitHub pull request UI.

output.images[].caption String No

A short image description.

output.images[].image_url String Yes

The full URL of the image.

output.images[].alt String Yes

The alternative text for the image.

output.title String Yes

The title of the check run.

output.summary String Yes

The summary of the check run. This parameter supports Markdown. Maximum length: 65535 characters.

details_url String 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.

status String No

The current status of the check run. Only GitHub Actions can set a status of waiting, pending, or requested.

Possible values:

  • "requested"
  • "in_progress"
  • "completed"
  • "queued"
  • "waiting"
  • "pending"

Default value: "queued"

completed_at String No

The time the check completed. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

conclusion String No

Required if you provide completed_at or a status of completed. The final conclusion of the check. Note: Providing conclusion will automatically set the status parameter to completed. You cannot change a check run conclusion to stale, only GitHub can set this.

Possible values:

  • "action_required"
  • "skipped"
  • "neutral"
  • "success"
  • "failure"
  • "stale"
  • "cancelled"
  • "timed_out"
started_at String No

The time that the check run began. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.