View Source GitHub.Checks (GitHub REST API Client v0.2.2)

Provides API endpoints related to checks

Link to this section Summary

Link to this section Functions

Link to this function

create(owner, repo, body, opts \\ [])

View Source
@spec create(String.t(), String.t(), map(), keyword()) ::
  {:ok, GitHub.Check.Run.t()} | {:error, GitHub.Error.t()}

Create a check run

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.

resources

Resources

Link to this function

create_suite(owner, repo, body, opts \\ [])

View Source
@spec create_suite(String.t(), String.t(), map(), keyword()) ::
  {:ok, GitHub.Check.Suite.t()} | {:error, GitHub.Error.t()}

Create a check suite

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.

resources

Resources

Link to this function

get(owner, repo, check_run_id, opts \\ [])

View Source
@spec get(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.Check.Run.t()} | {:error, GitHub.Error.t()}

Get a check run

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.

resources

Resources

Link to this function

get_suite(owner, repo, check_suite_id, opts \\ [])

View Source
@spec get_suite(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.Check.Suite.t()} | {:error, GitHub.Error.t()}

Get a check suite

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.

resources

Resources

Link to this function

list_annotations(owner, repo, check_run_id, opts \\ [])

View Source
@spec list_annotations(String.t(), String.t(), integer(), keyword()) ::
  {:ok, [GitHub.Check.Annotation.t()]} | {:error, GitHub.Error.t()}

List check run annotations

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.

options

Options

  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_for_ref(owner, repo, ref, opts \\ [])

View Source
@spec list_for_ref(String.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, GitHub.Error.t()}

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

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 endpoint and provide the check_suite_id parameter to the List check runs in a check suite endpoint.

options

Options

  • check_name: Returns check runs with the specified name.
  • status: Returns check runs with the specified status.
  • filter: Filters check runs by their completed_at timestamp. latest returns the most recent check runs.
  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.
  • app_id

resources

Resources

Link to this function

list_for_suite(owner, repo, check_suite_id, opts \\ [])

View Source
@spec list_for_suite(String.t(), String.t(), integer(), keyword()) ::
  {:ok, map()} | {:error, GitHub.Error.t()}

List check runs in a check suite

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.

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.

options

Options

  • check_name: Returns check runs with the specified name.
  • status: Returns check runs with the specified status.
  • filter: Filters check runs by their completed_at timestamp. latest returns the most recent check runs.
  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_suites_for_ref(owner, repo, ref, opts \\ [])

View Source
@spec list_suites_for_ref(String.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, GitHub.Error.t()}

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

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.

options

Options

  • app_id: Filters check suites by GitHub App id.
  • check_name: Returns check runs with the specified name.
  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

rerequest_run(owner, repo, check_run_id, opts \\ [])

View Source
@spec rerequest_run(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.EmptyObject.t()} | {:error, GitHub.Error.t()}

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 event with the action rerequested. When a check run is rerequested, its status is reset to queued and the conclusion is cleared.

To rerequest a check run, your GitHub App must have the checks:read permission on a private repository or pull access to a public repository.

For more information about how to re-run GitHub Actions jobs, see "Re-run a job from a workflow run".

resources

Resources

Link to this function

rerequest_suite(owner, repo, check_suite_id, opts \\ [])

View Source
@spec rerequest_suite(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.EmptyObject.t()} | {:error, GitHub.Error.t()}

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 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:write permission on a private repository or pull access to a public repository.

resources

Resources

Link to this function

set_suites_preferences(owner, repo, body, opts \\ [])

View Source
@spec set_suites_preferences(String.t(), String.t(), map(), keyword()) ::
  {:ok, GitHub.Check.SuitePreference.t()} | {:error, GitHub.Error.t()}

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. You must have admin permissions in the repository to set preferences for check suites.

resources

Resources

Link to this function

update(owner, repo, check_run_id, body, opts \\ [])

View Source
@spec update(String.t(), String.t(), integer(), map(), keyword()) ::
  {:ok, GitHub.Check.Run.t()} | {:error, GitHub.Error.t()}

Update a check run

Updates a check run for a specific commit in a repository. Your GitHub App must have the checks:write permission to edit check runs.

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.

resources

Resources