Skip to content

Create a repo-level variable

POST
/repos/{owner}/{repo}/actions/variables/{variablename}
owner
required
string

Name of the owner

repo
required
string

Name of the repository

variablename
required
string

Name of the variable

CreateVariableOption defines the properties of the variable to create.
object
value
required

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.

string
Examplegenerated
{
"value": "example"
}

Response when creating a repo-level variable

Media typeapplication/json

Response when creating a repo-level variable

Media typeapplication/json

APIError is error format response

Media typeapplication/json

APIError is an api error with a message

object
message
string
url
string
Examplegenerated
{
"message": "example",
"url": "example"
}

APINotFound is a not found error response

Media typeapplication/json
object
errors
Array<string>
message
string
url
string
Examplegenerated
{
"errors": [
"example"
],
"message": "example",
"url": "example"
}