protection_rules
Overview
Name | protection_rules |
Type | Resource |
Id | github.repos.protection_rules |
Fields
Name | Datatype | Description |
---|---|---|
id | integer | The unique identifier for the deployment protection rule. |
app | object | A GitHub App that is providing a custom deployment protection rule. |
enabled | boolean | Whether the deployment protection rule is enabled for the environment. |
node_id | string | The node ID for the deployment protection rule. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get_all_deployment_protection_rules | SELECT | environment_name, owner, repo | Gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. If the repository is private and you want to use a personal access token (classic), you must use an access token with the repo scope. GitHub Apps and fine-grained personal access tokens must have the actions:read permission to use this endpoint. For more information about environments, see "Using environments for deployment."For more information about the app that is providing this custom deployment rule, see the documentation for the GET /apps/{app_slug} endpoint. |
get_custom_deployment_protection_rule | SELECT | environment_name, owner, protection_rule_id, repo | Gets an enabled custom deployment protection rule for an environment. Anyone with read access to the repository can use this endpoint. If the repository is private and you want to use a personal access token (classic), you must use an access token with the repo scope. GitHub Apps and fine-grained personal access tokens must have the actions:read permission to use this endpoint. For more information about environments, see "Using environments for deployment."For more information about the app that is providing this custom deployment rule, see GET /apps/{app_slug} . |
create_deployment_protection_rule | INSERT | environment_name, owner, repo | Enable a custom deployment protection rule for an environment. You must authenticate using an access token with the repo scope to use this endpoint. Enabling a custom protection rule requires admin or owner permissions to the repository. GitHub Apps must have the actions:write permission to use this endpoint.For more information about the app that is providing this custom deployment rule, see the documentation for the GET /apps/{app_slug} endpoint. |
disable_deployment_protection_rule | EXEC | environment_name, owner, protection_rule_id, repo | Disables a custom deployment protection rule for an environment. You must authenticate using an access token with the repo scope to use this endpoint. Removing a custom protection rule requires admin or owner permissions to the repository. GitHub Apps must have the actions:write permission to use this endpoint. For more information, see "Get an app". |