Convenience functions for the GitHub Checks REST API.
Thin wrappers over GhEx.REST that return the same {:ok, body, meta} /
{:error, reason} shape; opts pass through to Req.
Summary
Functions
Creates a check run.
Finds a GitHub App's check run with check_name on a git ref.
Gets a check run by id.
Lists the annotations attached to a check run.
Lists check runs for a git ref.
Rerequests a check run without pushing new code.
Auto-paginates a check run's annotations into a lazy Stream.
Auto-paginates the check runs for a git ref into a lazy Stream, unwrapping
the "check_runs" array on each page (see GhEx.REST.stream/3).
Updates a check run.
Types
Functions
@spec create_run(GhEx.Client.t(), String.t(), String.t(), map(), keyword()) :: GhEx.REST.result()
Creates a check run.
@spec find_run_for_ref( GhEx.Client.t(), String.t(), String.t(), String.t(), String.t(), integer() | String.t(), keyword() ) :: GhEx.REST.result()
Finds a GitHub App's check run with check_name on a git ref.
Returns {:ok, run, meta} for the first run GitHub returns, or
{:ok, nil, meta} when none matches. GitHub defaults the endpoint to its
latest filter. This function only performs the lookup; the caller decides
whether to call create_run/5 or update_run/6 next.
app_id is the numeric GitHub App ID, not an installation ID or OAuth client
ID. Reuse the numeric ID passed when building the app client described by
GhEx.App, or authenticate as the app and read it from:
{:ok, %{"id" => app_id}, _meta} = GhEx.REST.get(app_client, "/app")Caller-supplied query parameters are preserved, but check_name and app_id
are always set from their explicit arguments.
@spec get_run(GhEx.Client.t(), String.t(), String.t(), id(), keyword()) :: GhEx.REST.result()
Gets a check run by id.
@spec list_annotations(GhEx.Client.t(), String.t(), String.t(), id(), keyword()) :: GhEx.REST.result()
Lists the annotations attached to a check run.
@spec list_for_ref(GhEx.Client.t(), String.t(), String.t(), String.t(), keyword()) :: GhEx.REST.result()
Lists check runs for a git ref.
@spec rerequest_run(GhEx.Client.t(), String.t(), String.t(), id(), keyword()) :: GhEx.REST.result()
Rerequests a check run without pushing new code.
GitHub resets the containing check suite and emits a check_run webhook with
the rerequested action. The app that owns the run must handle that webhook
and update the check run as needed. This is separate from rerunning a GitHub
Actions workflow through GhEx.Actions and requires Checks write permission.
@spec stream_annotations(GhEx.Client.t(), String.t(), String.t(), id(), keyword()) :: Enumerable.t()
Auto-paginates a check run's annotations into a lazy Stream.
@spec stream_for_ref(GhEx.Client.t(), String.t(), String.t(), String.t(), keyword()) :: Enumerable.t()
Auto-paginates the check runs for a git ref into a lazy Stream, unwrapping
the "check_runs" array on each page (see GhEx.REST.stream/3).
@spec update_run(GhEx.Client.t(), String.t(), String.t(), id(), map(), keyword()) :: GhEx.REST.result()
Updates a check run.