Sample - GitHub REST API
POST/repos/{owner}/{repo}/check-runs

Create a check run

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.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters · 10 body fields
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
namestringrequired
The name of the check. For example, "code-coverage".
head_shastringrequired
The SHA of the commit.
details_urlstringoptional
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_idstringoptional
A reference for the run on the integrator's system.
statusstringoptional
The current status of the check run. Only GitHub Actions can set a status of `waiting`, `pending`, or `requested`.
Allowed:queuedin_progresscompletedwaitingrequestedpendingDefault:queued
started_atstringoptional
The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
conclusionstringoptional
**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.
Allowed:action_requiredcancelledfailureneutralsuccessskippedstaletimed_out
completed_atstringoptional
The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
outputobjectoptional
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.
actionsarray<object>optional
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](https://docs.github.com/webhooks/event-payloads/#check_run) 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](https://docs.github.com/rest/guides/using-the-rest-api-to-interact-with-checks#check-runs-and-requested-actions)."

1 status code
201Response
idintegerrequired
The id of the check.
head_shastringrequired
The SHA of the commit that is being checked.
node_idstringrequired
external_idstringrequired
urlstringrequired
html_urlstringrequired
details_urlstringrequired
statusstringrequired
The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs.
Allowed:queuedin_progresscompletedwaitingrequestedpending
conclusionstringrequired
Allowed:successfailureneutralcancelledskippedtimed_outaction_required
started_atstringrequired
completed_atstringrequired
outputobjectrequired
namestringrequired
The name of the check.
check_suiteobjectrequired
appobjectrequired
GitHub 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.
pull_requestsarray<PullRequestMinimal>required
Pull 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.
deploymentobjectoptional
A deployment created as the result of an Actions check run from a workflow that references an environment