Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
This is the documentation of 1.25.5, which is no longer the latest release. See the latest release.

Create a repo-level variable

POST
/repos/{owner}/{repo}/actions/variables/{variablename}
curl --request POST \
--url https://gitea.com/api/v1/repos/example/example/actions/variables/example \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "description": "example", "value": "example" }'
owner
required
string

Owner of the repo

repo
required
string

Name of the repository

variablename
required
string

Name of the variable

CreateVariableOption the option when creating variable

object
description

Description of the variable to create

string
value
required

Value of the variable to create

string
Examplegenerated
{
"description": "example",
"value": "example"
}

Response when creating a repo-level variable

Media typeapplication/json

APIError is error format response

Media typeapplication/json
message
string
url
string

Variable name already exists.

Media typeapplication/json

APIError is error format response

Media typeapplication/json
message
string
url
string