GhEx.Actions (gh_ex v0.3.1)

Copy Markdown View Source

Convenience functions for the GitHub Actions REST API (workflows and runs).

Thin wrappers over GhEx.REST that return the same {:ok, body, meta} / {:error, reason} shape; opts pass through to Req. A workflow is the numeric workflow id or its file name (for example "ci.yml").

Summary

Functions

Triggers a workflow_dispatch event. attrs is the JSON body: ref (required) and optional inputs. Returns a 204 with an empty body on success.

Gets a workflow by id or file name.

Lists the jobs for a workflow run.

Lists workflow runs in a repository. Use params: for branch, status, event.

Lists the workflows in a repository.

Types

id()

@type id() :: integer() | String.t()

Functions

cancel_run(client, owner, repo, run_id, opts \\ [])

@spec cancel_run(GhEx.Client.t(), String.t(), String.t(), id(), keyword()) ::
  GhEx.REST.result()

Cancels a workflow run.

dispatch_workflow(client, owner, repo, workflow, attrs, opts \\ [])

@spec dispatch_workflow(
  GhEx.Client.t(),
  String.t(),
  String.t(),
  id(),
  map(),
  keyword()
) ::
  GhEx.REST.result()

Triggers a workflow_dispatch event. attrs is the JSON body: ref (required) and optional inputs. Returns a 204 with an empty body on success.

get_run(client, owner, repo, run_id, opts \\ [])

@spec get_run(GhEx.Client.t(), String.t(), String.t(), id(), keyword()) ::
  GhEx.REST.result()

Gets a workflow run.

get_workflow(client, owner, repo, workflow, opts \\ [])

@spec get_workflow(GhEx.Client.t(), String.t(), String.t(), id(), keyword()) ::
  GhEx.REST.result()

Gets a workflow by id or file name.

list_run_jobs(client, owner, repo, run_id, opts \\ [])

@spec list_run_jobs(GhEx.Client.t(), String.t(), String.t(), id(), keyword()) ::
  GhEx.REST.result()

Lists the jobs for a workflow run.

list_runs(client, owner, repo, opts \\ [])

@spec list_runs(GhEx.Client.t(), String.t(), String.t(), keyword()) ::
  GhEx.REST.result()

Lists workflow runs in a repository. Use params: for branch, status, event.

list_workflows(client, owner, repo, opts \\ [])

@spec list_workflows(GhEx.Client.t(), String.t(), String.t(), keyword()) ::
  GhEx.REST.result()

Lists the workflows in a repository.

rerun(client, owner, repo, run_id, opts \\ [])

@spec rerun(GhEx.Client.t(), String.t(), String.t(), id(), keyword()) ::
  GhEx.REST.result()

Re-runs a workflow run.