GhEx.Releases (gh_ex v0.3.3)

Copy Markdown View Source

Convenience functions for the GitHub Releases 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 release. attrs is the JSON body (tag_name, name, body, draft, prerelease, ...).

Gets the latest published release.

Lists releases for a repository.

Auto-paginates a repository's releases into a lazy Stream (see GhEx.REST.stream/3).

Types

id()

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

Functions

create(client, owner, repo, attrs, opts \\ [])

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

Creates a release. attrs is the JSON body (tag_name, name, body, draft, prerelease, ...).

delete(client, owner, repo, id, opts \\ [])

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

Deletes a release.

get(client, owner, repo, id, opts \\ [])

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

Gets a release by id.

get_by_tag(client, owner, repo, tag, opts \\ [])

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

Gets a release by tag name.

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

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

Gets the latest published release.

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

Lists releases for a repository.

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

@spec stream(GhEx.Client.t(), String.t(), String.t(), keyword()) :: Enumerable.t()

Auto-paginates a repository's releases into a lazy Stream (see GhEx.REST.stream/3).

update(client, owner, repo, id, attrs, opts \\ [])

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

Updates a release.