gitea.cli.actions.variable.create
create
Create an Actions variable of a repository, an organization or the account.
Creating and updating are two endpoints here, where setting a secret is one: a
name that already exists is reported as a conflict rather than being overwritten.
So this never replaces a value by accident, and
gitea-cli actions variable update is how one is replaced on purpose.
Which scope is asked for follows the usual convention: --owner with
--repository for a repository's own, --owner alone for an organization's, and
neither for those of the authenticated account.
Functions:
gitea.cli.actions.variable.create.create_variable_command
create_variable_command(
ctx: Context,
variable_name: Annotated[
str,
Option("--variable-name", help=VARIABLE_NAME_HELP),
],
value: Annotated[
str,
Option(
"--value",
help="Value to store in the variable.",
),
],
owner: Annotated[
str | None, Option("--owner", help=OWNER_SCOPE_HELP)
] = None,
repository: Annotated[
str | None,
Option("--repository", help=REPOSITORY_SCOPE_HELP),
] = None,
description: Annotated[
str | None,
Option(
"--description",
help="What the variable is for, shown alongside it in the web UI.",
),
] = None,
account_name: Annotated[
str | None,
Option(
"--account-name",
help="Name of the account to use for authentication.",
),
] = None,
token: Annotated[
str | None,
Option(
"--token",
help="Token for authentication. If not provided, the token from the specified account will be used.",
),
] = None,
base_url: Annotated[
str | None,
Option(
"--base-url",
help="Base URL of the Gitea platform. If not provided, the base URL from the specified account will be used.",
),
] = None,
) -> None
Create an Actions variable of a repository, an organization or the account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
The Typer context. |
required |
variable_name
|
Annotated[str, Option('--variable-name', help=VARIABLE_NAME_HELP)]
|
The name of the variable. |
required |
value
|
Annotated[str, Option('--value', help='Value to store in the variable.')]
|
The value to store. |
required |
owner
|
Annotated[str | None, Option('--owner', help=OWNER_SCOPE_HELP)]
|
The owner of the repository, or the organization itself. |
None
|
repository
|
Annotated[str | None, Option('--repository', help=REPOSITORY_SCOPE_HELP)]
|
The name of the repository, to narrow the owner to one of its repositories. |
None
|
description
|
Annotated[str | None, Option('--description', help='What the variable is for, shown alongside it in the web UI.')]
|
What the variable is for. |
None
|
account_name
|
Annotated[str | None, Option('--account-name', help='Name of the account to use for authentication.')]
|
Name of the account to use for authentication. |
None
|
token
|
Annotated[str | None, Option('--token', help='Token for authentication. If not provided, the token from the specified account will be used.')]
|
Token for authentication. |
None
|
base_url
|
Annotated[str | None, Option('--base-url', help='Base URL of the Gitea platform. If not provided, the base URL from the specified account will be used.')]
|
Base URL of the Gitea platform. |
None
|