Skip to content

variables

Accessed as client.repos.actions.variables; the async client mirrors it.

ReposActionsVariables

The repos.actions.variables namespace.

create

create(owner: str, repo: str, variablename: str, *, value: str) -> None

Create a repo-level variable.

Parameters:

Name Type Description Default
owner str

name of the owner

required
repo str

name of the repository

required
variablename str

name of the variable

required
value str

Value of the variable to create. Special characters will be retained. Line endings will be normalized to LF to match the behaviour of browsers. Encode the data with Base64 if line endings should be retained.

required

Returns:

Type Description
None

No content.

Raises:

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

Operation ID: createRepoVariable

delete

delete(owner: str, repo: str, variablename: str) -> None

Delete a repo-level variable.

Parameters:

Name Type Description Default
owner str

name of the owner

required
repo str

name of the repository

required
variablename str

name of the variable

required

Returns:

Type Description
None

No content.

Raises:

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

Operation ID: deleteRepoVariable

get

get(owner: str, repo: str, variablename: str) -> ActionVariable

Get a repo-level variable.

Parameters:

Name Type Description Default
owner str

name of the owner

required
repo str

name of the repository

required
variablename str

name of the variable

required

Returns:

Type Description
ActionVariable

ActionVariable.

Raises:

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

Operation ID: getRepoVariable

list

list(owner: str, repo: str, *, page: int | None = None, limit: int | None = None) -> Paginated[ActionVariable]

Get repo-level variables list.

Parameters:

Name Type Description Default
owner str

name of the owner

required
repo str

name of the repository

required
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[ActionVariable]

VariableList.

Raises:

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

Operation ID: getRepoVariablesList

update

update(owner: str, repo: str, variablename: str, *, name: str | None = None, value: str) -> None

Update a repo-level variable.

Parameters:

Name Type Description Default
owner str

name of the owner

required
repo str

name of the repository

required
variablename str

name of the variable

required
name str | None

New name for the variable. If the field is empty, the variable name won't be updated. Forgejo will convert it to uppercase.

None
value str

Value of the variable to update. Special characters will be retained. Line endings will be normalized to LF to match the behaviour of browsers. Encode the data with Base64 if line endings should be retained.

required

Returns:

Type Description
None

No content.

Raises:

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

Operation ID: updateRepoVariable

AsyncReposActionsVariables

The repos.actions.variables namespace.

create

create(owner: str, repo: str, variablename: str, *, value: str) -> None

Create a repo-level variable.

Parameters:

Name Type Description Default
owner str

name of the owner

required
repo str

name of the repository

required
variablename str

name of the variable

required
value str

Value of the variable to create. Special characters will be retained. Line endings will be normalized to LF to match the behaviour of browsers. Encode the data with Base64 if line endings should be retained.

required

Returns:

Type Description
None

No content.

Raises:

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

Operation ID: createRepoVariable

delete

delete(owner: str, repo: str, variablename: str) -> None

Delete a repo-level variable.

Parameters:

Name Type Description Default
owner str

name of the owner

required
repo str

name of the repository

required
variablename str

name of the variable

required

Returns:

Type Description
None

No content.

Raises:

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

Operation ID: deleteRepoVariable

get

get(owner: str, repo: str, variablename: str) -> ActionVariable

Get a repo-level variable.

Parameters:

Name Type Description Default
owner str

name of the owner

required
repo str

name of the repository

required
variablename str

name of the variable

required

Returns:

Type Description
ActionVariable

ActionVariable.

Raises:

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

Operation ID: getRepoVariable

list

list(owner: str, repo: str, *, page: int | None = None, limit: int | None = None) -> AsyncPaginated[ActionVariable]

Get repo-level variables list.

Parameters:

Name Type Description Default
owner str

name of the owner

required
repo str

name of the repository

required
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[ActionVariable]

VariableList.

Raises:

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

Operation ID: getRepoVariablesList

update

update(owner: str, repo: str, variablename: str, *, name: str | None = None, value: str) -> None

Update a repo-level variable.

Parameters:

Name Type Description Default
owner str

name of the owner

required
repo str

name of the repository

required
variablename str

name of the variable

required
name str | None

New name for the variable. If the field is empty, the variable name won't be updated. Forgejo will convert it to uppercase.

None
value str

Value of the variable to update. Special characters will be retained. Line endings will be normalized to LF to match the behaviour of browsers. Encode the data with Base64 if line endings should be retained.

required

Returns:

Type Description
None

No content.

Raises:

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

Operation ID: updateRepoVariable