layout | page_title | sidebar_current | description |
---|---|---|---|
gitlab |
GitLab: gitlab_branch_protection |
docs-gitlab-resource-branch_protection |
Protects a branch by assigning access levels to it |
This resource allows you to protect a specific branch by an access level so that the user with less access level cannot Merge/Push to the branch. GitLab EE features to protect by group or user are not supported.
resource "gitlab_branch_protection" "BranchProtect" {
project = "12345"
branch = "BranchProtected"
push_access_level = "developer"
merge_access_level = "developer"
}
The following arguments are supported:
-
project
- (Required) The id of the project. -
branch
- (Required) Name of the branch. -
push_access_level
- (Required) One of five levels of access to the project. -
merge_access_level
- (Required) One of five levels of access to the project.