repos
List environments
Changed onLists the environments for a repository.
Anyone with read access to the repository can use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.
get/repos/{owner}/{repo}/environments
Request
- Base URL: http://HOSTNAME/api/v3
- URL: http://HOSTNAME/api/v3/repos/{owner}/{repo}/environments
- Auth: none declared
Path parameters
ownerstring required
The account owner of the repository. The name is not case sensitive.
repostring required
The name of the repository without the .git extension. The name is not case sensitive.
Query parameters
per_pageinteger
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
pageinteger
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Response
Response
Example response
{
"total_count": 5,
"environments": [
{
"id": 56780428,
"node_id": "MDExOkVudmlyb25tZW50NTY3ODA0Mjg=",
"name": "staging",
"url": "https://api.github.com/repos/github/hello-world/environments/staging",
"html_url": "https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging",
"created_at": "2020-11-23T22:00:40Z",
"updated_at": "2020-11-23T22:00:40Z",
"protection_rules": [
{
"id": 3515,
"node_id": "MDQ6R2F0ZTM1MTU=",
"type": "wait_timer",
"wait_timer": 30
}
]
}
]
}Changes
- warning
removed the optional property
/////from the response with the status
- warning
- info
added the optional property
/////to the response with the status
- info