The gitlab_project_protected_branches
data source allows details of the protected branches of a given project.
Upstream API: GitLab REST API docs
data "gitlab_project_protected_branches" "example" {
project_id = 30
}
data "gitlab_project_protected_branches" "example" {
project_id = "foo/bar/baz"
}
project_id
(String) The integer or path with namespace that uniquely identifies the project.protected_branches
(Block List) A list of protected branches, as defined below. (see below for nested schema)id
(Number) The ID of this resource.protected_branches
Optional:
merge_access_levels
(Block Set) Array of access levels and user(s)/group(s) allowed to merge to protected branch. (see below for nested schema)push_access_levels
(Block Set) Array of access levels and user(s)/group(s) allowed to push to protected branch. (see below for nested schema)Read-Only:
allow_force_push
(Boolean) Whether force push is allowed.code_owner_approval_required
(Boolean) Reject code pushes that change files listed in the CODEOWNERS file.id
(Number) The ID of this resource.name
(String) The name of the protected branch.protected_branches.merge_access_levels
Optional:
group_id
(Number) The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id
.user_id
(Number) The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id
.Read-Only:
access_level
(String) Access levels allowed to merge to protected branch. Valid values are: no one
, developer
, maintainer
.access_level_description
(String) Readable description of access level.protected_branches.push_access_levels
Optional:
group_id
(Number) The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id
.user_id
(Number) The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id
.Read-Only:
access_level
(String) Access levels allowed to push to protected branch. Valid values are: no one
, developer
, maintainer
.access_level_description
(String) Readable description of access level.