Get an environment
Note: To get information about name patterns that branches must match in order to deploy to this environment, see "Get a deployment branch policy."
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.
Path parameters
The account owner of the repository. The name is not case sensitive.
The name of the repository without the .git extension. The name is not case sensitive.
The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with %2F.
Response
Response
Example response
{
"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
Changed in 2 of the 50 revisions of this API.11
- ●
removed the optional property
protection_rules/items/anyOf[subschema #2]/prevent_self_reviewfrom the response with the200statusresponse-optional-property-removed
- ●
- ○
added the optional property
protection_rules/items/anyOf[subschema #2]/prevent_self_reviewto the response with the200statusresponse-optional-property-added
- ○