Skip to main content

environments

Overview

Nameenvironments
TypeResource
Idgithub.repos.environments

Fields

NameDatatypeDescription
idintegerThe id of the environment.
namestringThe name of the environment.
created_atstringThe time that the environment was created, in ISO 8601 format.
deployment_branch_policyobjectThe type of deployment branch policy for this environment. To allow all branches to deploy, set to null.
html_urlstring
node_idstring
protection_rulesarrayBuilt-in deployment protection rules for the environment.
updated_atstringThe time that the environment was last updated, in ISO 8601 format.
urlstring

Methods

NameAccessible byRequired ParamsDescription
get_all_environmentsSELECTowner, repoLists 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_environmentSELECTenvironment_name, owner, repoNote: 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. 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.
create_or_update_environmentINSERTenvironment_name, owner, repoCreate or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "Environments."

Note: To create or update name patterns that branches must match in order to deploy to this environment, see "Deployment branch policies."

Note: To create or update secrets for an environment, see "GitHub Actions secrets."

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration:write permission for the repository to use this endpoint.
delete_an_environmentDELETEenvironment_name, owner, repoYou must authenticate using an access token with the repo scope to use this endpoint.