Skip to content

releases

Accessed as client.repos.releases; the async client mirrors it.

ReposReleases

The repos.releases namespace.

assets

tags

create

create(
    owner: str,
    repo: str,
    *,
    body: str | None = None,
    draft: bool | None = None,
    hide_archive_links: bool | None = None,
    name: str | None = None,
    prerelease: bool | None = None,
    tag_name: str,
    target_commitish: str | None = None,
) -> Release

Create a release.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
body str | None
None
draft bool | None
None
hide_archive_links bool | None
None
name str | None
None
prerelease bool | None
None
tag_name str
required
target_commitish str | None
None

Returns:

Type Description
Release

Release.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
ConflictError
  1. APIError is error format response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: repoCreateRelease

delete

delete(owner: str, repo: str, id: int) -> None

Delete a release.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the release to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: repoDeleteRelease

get

get(owner: str, repo: str, id: int) -> Release

Get a release.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the release to get

required

Returns:

Type Description
Release

Release.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: repoGetRelease

latest

latest(owner: str, repo: str) -> Release

Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required

Returns:

Type Description
Release

Release.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: repoGetLatestRelease

list

list(
    owner: str,
    repo: str,
    *,
    draft: bool | None = None,
    pre_release: bool | None = None,
    q: str | None = None,
    page: int | None = None,
    limit: int | None = None,
) -> Paginated[Release]

List a repo's releases.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
draft bool | None

filter (exclude / include) drafts, if you dont have repo write access none will show

None
pre_release bool | None

filter (exclude / include) pre-releases

None
q str | None

Search string

None
page int | None

1-based page to start iteration at.

None
limit int | None

Page size; the instance caps it server-side.

None

Returns:

Type Description
Paginated[Release]

ReleaseList.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: repoListReleases

update

update(
    owner: str,
    repo: str,
    id: int,
    *,
    body: str | None = None,
    draft: bool | None = None,
    hide_archive_links: bool | None = None,
    name: str | None = None,
    prerelease: bool | None = None,
    tag_name: str | None = None,
    target_commitish: str | None = None,
) -> Release

Update a release.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the release to edit

required
body str | None
None
draft bool | None
None
hide_archive_links bool | None
None
name str | None
None
prerelease bool | None
None
tag_name str | None
None
target_commitish str | None
None

Returns:

Type Description
Release

Release.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: repoEditRelease

AsyncReposReleases

The repos.releases namespace.

create

create(
    owner: str,
    repo: str,
    *,
    body: str | None = None,
    draft: bool | None = None,
    hide_archive_links: bool | None = None,
    name: str | None = None,
    prerelease: bool | None = None,
    tag_name: str,
    target_commitish: str | None = None,
) -> Release

Create a release.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
body str | None
None
draft bool | None
None
hide_archive_links bool | None
None
name str | None
None
prerelease bool | None
None
tag_name str
required
target_commitish str | None
None

Returns:

Type Description
Release

Release.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
ConflictError
  1. APIError is error format response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: repoCreateRelease

delete

delete(owner: str, repo: str, id: int) -> None

Delete a release.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the release to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: repoDeleteRelease

get

get(owner: str, repo: str, id: int) -> Release

Get a release.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the release to get

required

Returns:

Type Description
Release

Release.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: repoGetRelease

latest

latest(owner: str, repo: str) -> Release

Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required

Returns:

Type Description
Release

Release.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: repoGetLatestRelease

list

list(
    owner: str,
    repo: str,
    *,
    draft: bool | None = None,
    pre_release: bool | None = None,
    q: str | None = None,
    page: int | None = None,
    limit: int | None = None,
) -> AsyncPaginated[Release]

List a repo's releases.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
draft bool | None

filter (exclude / include) drafts, if you dont have repo write access none will show

None
pre_release bool | None

filter (exclude / include) pre-releases

None
q str | None

Search string

None
page int | None

1-based page to start iteration at.

None
limit int | None

Page size; the instance caps it server-side.

None

Returns:

Type Description
AsyncPaginated[Release]

ReleaseList.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: repoListReleases

update

update(
    owner: str,
    repo: str,
    id: int,
    *,
    body: str | None = None,
    draft: bool | None = None,
    hide_archive_links: bool | None = None,
    name: str | None = None,
    prerelease: bool | None = None,
    tag_name: str | None = None,
    target_commitish: str | None = None,
) -> Release

Update a release.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the release to edit

required
body str | None
None
draft bool | None
None
hide_archive_links bool | None
None
name str | None
None
prerelease bool | None
None
tag_name str | None
None
target_commitish str | None
None

Returns:

Type Description
Release

Release.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: repoEditRelease