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.
html_urlstring
deployment_branch_policyobjectThe type of deployment branch policy for this environment. To allow all branches to deploy, set to null.
node_idstring
protection_rulesarray
updated_atstringThe time that the environment was last updated, in ISO 8601 format.
urlstring

Methods

NameAccessible byRequired ParamsDescription
get_all_environmentsSELECTowner, repoGet all 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, repoAnyone 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: Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see "Environments."

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

You must authenticate using an access token with the repo scope to use this endpoint.
delete_an_environmentDELETEenvironment_name, owner, repoYou must authenticate using an access token with the repo scope to use this endpoint.