Skip to content

List repository variables

GET
/repos/{owner}/{repo}/actions/variables

Lists all repository variables.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

per_page
integer
default: 10

The number of results per page (max 30). For more information, see “Using pagination in the REST API.”

page
integer
default: 1

The page number of the results to fetch. For more information, see “Using pagination in the REST API.”

Response

Media type application/json
object
total_count
required
integer
variables
required
Array<object>
Actions Variable
object
name
required

The name of the variable.

string
value
required

The value of the variable.

string
created_at
required

The date and time at which the variable was created, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ.

string format: date-time
updated_at
required

The date and time at which the variable was last updated, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ.

string format: date-time
Examples
Example default
{
"total_count": 2,
"variables": [
{
"name": "USERNAME",
"value": "octocat",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z"
},
{
"name": "EMAIL",
"value": "octocat@github.com",
"created_at": "2020-01-10T10:59:22Z",
"updated_at": "2020-01-11T11:59:22Z"
}
]
}
Link
string
Example
<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"