# `GitHubEx.Checks`
[🔗](https://github.com/nshkrdotcom/github_ex/blob/v0.1.1/lib/github_ex/generated/checks.ex#L1)

Generated Github Ex operations for checks.

# `create`

```elixir
@spec create(term(), map(), keyword()) :: {:ok, term()} | {:error, term()}
```

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.

# `create_suite`

```elixir
@spec create_suite(term(), map(), keyword()) :: {:ok, term()} | {:error, term()}
```

Create a check suite

Creates a check suite manually. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/checks/runs). 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](https://docs.github.com/rest/checks/suites#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.

# `get`

```elixir
@spec get(term(), map(), keyword()) :: {:ok, term()} | {:error, term()}
```

Get a check run

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.

# `get_suite`

```elixir
@spec get_suite(term(), map(), keyword()) :: {:ok, term()} | {:error, term()}
```

Get a check suite

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.

# `list_annotations`

```elixir
@spec list_annotations(term(), map(), keyword()) :: {:ok, term()} | {:error, term()}
```

List check run annotations

Lists annotations for a check run using the annotation `id`.

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

# `list_for_ref`

```elixir
@spec list_for_ref(term(), map(), keyword()) :: {:ok, term()} | {:error, term()}
```

List check runs for a Git reference

Lists 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](https://docs.github.com/rest/reference/checks#list-check-suites-for-a-git-reference) endpoint and provide the `check_suite_id` parameter to the [List check runs in a check suite](https://docs.github.com/rest/reference/checks#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.

# `list_for_suite`

```elixir
@spec list_for_suite(term(), map(), keyword()) :: {:ok, term()} | {:error, term()}
```

List check runs in a check suite

Lists 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_suites_for_ref`

```elixir
@spec list_suites_for_ref(term(), map(), keyword()) ::
  {:ok, term()} | {:error, term()}
```

List check suites for a Git reference

Lists 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.

# `rerequest_run`

```elixir
@spec rerequest_run(term(), map(), keyword()) :: {:ok, term()} | {:error, term()}
```

Rerequest a check run

Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) 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](https://docs.github.com/webhooks/event-payloads/#check_run) with the `rerequested` action should then decide if the check run should be reset or updated and call the [update `check_run` endpoint](https://docs.github.com/rest/checks/runs#update-a-check-run) 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](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)".

# `rerequest_suite`

```elixir
@spec rerequest_suite(term(), map(), keyword()) :: {:ok, term()} | {:error, term()}
```

Rerequest a check suite

Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.

# `set_suites_preferences`

```elixir
@spec set_suites_preferences(term(), map(), keyword()) ::
  {:ok, term()} | {:error, term()}
```

Update repository preferences for check suites

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](https://docs.github.com/rest/checks/suites#create-a-check-suite).
You must have admin permissions in the repository to set preferences for check suites.

# `stream_list_annotations`

```elixir
@spec stream_list_annotations(term(), map(), keyword()) :: Enumerable.t()
```

# `stream_list_for_ref`

```elixir
@spec stream_list_for_ref(term(), map(), keyword()) :: Enumerable.t()
```

# `stream_list_for_suite`

```elixir
@spec stream_list_for_suite(term(), map(), keyword()) :: Enumerable.t()
```

# `stream_list_suites_for_ref`

```elixir
@spec stream_list_suites_for_ref(term(), map(), keyword()) :: Enumerable.t()
```

# `update`

```elixir
@spec update(term(), map(), keyword()) :: {:ok, term()} | {:error, term()}
```

Update a check run

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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
