v50

latestOpenAPI 3.0.3MITraw.githubusercontent.com2023-11-288093493.9 MB
repos

List environments

Lists the environments for a repository.

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

get/repos/{owner}/{repo}/environments

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).

pageinteger

Page number of the results to fetch.

Response

Response

total_countinteger

The number of environments in this repository

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
        }
      ]
    }
  ]
}