1. Packages
  2. Gitlab Provider
  3. API Docs
  4. getProjectProtectedBranches
GitLab v8.11.0 published on Friday, Apr 18, 2025 by Pulumi

gitlab.getProjectProtectedBranches

Explore with Pulumi AI

The gitlab.getProjectProtectedBranches data source allows details of the protected branches of a given project.

Upstream API: GitLab REST API docs

Using getProjectProtectedBranches

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getProjectProtectedBranches(args: GetProjectProtectedBranchesArgs, opts?: InvokeOptions): Promise<GetProjectProtectedBranchesResult>
function getProjectProtectedBranchesOutput(args: GetProjectProtectedBranchesOutputArgs, opts?: InvokeOptions): Output<GetProjectProtectedBranchesResult>
Copy
def get_project_protected_branches(project_id: Optional[str] = None,
                                   protected_branches: Optional[Sequence[GetProjectProtectedBranchesProtectedBranch]] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetProjectProtectedBranchesResult
def get_project_protected_branches_output(project_id: Optional[pulumi.Input[str]] = None,
                                   protected_branches: Optional[pulumi.Input[Sequence[pulumi.Input[GetProjectProtectedBranchesProtectedBranchArgs]]]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetProjectProtectedBranchesResult]
Copy
func GetProjectProtectedBranches(ctx *Context, args *GetProjectProtectedBranchesArgs, opts ...InvokeOption) (*GetProjectProtectedBranchesResult, error)
func GetProjectProtectedBranchesOutput(ctx *Context, args *GetProjectProtectedBranchesOutputArgs, opts ...InvokeOption) GetProjectProtectedBranchesResultOutput
Copy

> Note: This function is named GetProjectProtectedBranches in the Go SDK.

public static class GetProjectProtectedBranches 
{
    public static Task<GetProjectProtectedBranchesResult> InvokeAsync(GetProjectProtectedBranchesArgs args, InvokeOptions? opts = null)
    public static Output<GetProjectProtectedBranchesResult> Invoke(GetProjectProtectedBranchesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetProjectProtectedBranchesResult> getProjectProtectedBranches(GetProjectProtectedBranchesArgs args, InvokeOptions options)
public static Output<GetProjectProtectedBranchesResult> getProjectProtectedBranches(GetProjectProtectedBranchesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gitlab:index/getProjectProtectedBranches:getProjectProtectedBranches
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ProjectId This property is required. string
The integer or path with namespace that uniquely identifies the project.
ProtectedBranches List<Pulumi.GitLab.Inputs.GetProjectProtectedBranchesProtectedBranch>
A list of protected branches, as defined below.
ProjectId This property is required. string
The integer or path with namespace that uniquely identifies the project.
ProtectedBranches []GetProjectProtectedBranchesProtectedBranch
A list of protected branches, as defined below.
projectId This property is required. String
The integer or path with namespace that uniquely identifies the project.
protectedBranches List<GetProjectProtectedBranchesProtectedBranch>
A list of protected branches, as defined below.
projectId This property is required. string
The integer or path with namespace that uniquely identifies the project.
protectedBranches GetProjectProtectedBranchesProtectedBranch[]
A list of protected branches, as defined below.
project_id This property is required. str
The integer or path with namespace that uniquely identifies the project.
protected_branches Sequence[GetProjectProtectedBranchesProtectedBranch]
A list of protected branches, as defined below.
projectId This property is required. String
The integer or path with namespace that uniquely identifies the project.
protectedBranches List<Property Map>
A list of protected branches, as defined below.

getProjectProtectedBranches Result

The following output properties are available:

Id int
The ID of this resource.
ProjectId string
The integer or path with namespace that uniquely identifies the project.
ProtectedBranches List<Pulumi.GitLab.Outputs.GetProjectProtectedBranchesProtectedBranch>
A list of protected branches, as defined below.
Id int
The ID of this resource.
ProjectId string
The integer or path with namespace that uniquely identifies the project.
ProtectedBranches []GetProjectProtectedBranchesProtectedBranch
A list of protected branches, as defined below.
id Integer
The ID of this resource.
projectId String
The integer or path with namespace that uniquely identifies the project.
protectedBranches List<GetProjectProtectedBranchesProtectedBranch>
A list of protected branches, as defined below.
id number
The ID of this resource.
projectId string
The integer or path with namespace that uniquely identifies the project.
protectedBranches GetProjectProtectedBranchesProtectedBranch[]
A list of protected branches, as defined below.
id int
The ID of this resource.
project_id str
The integer or path with namespace that uniquely identifies the project.
protected_branches Sequence[GetProjectProtectedBranchesProtectedBranch]
A list of protected branches, as defined below.
id Number
The ID of this resource.
projectId String
The integer or path with namespace that uniquely identifies the project.
protectedBranches List<Property Map>
A list of protected branches, as defined below.

Supporting Types

GetProjectProtectedBranchesProtectedBranch

AllowForcePush This property is required. bool
Whether force push is allowed.
CodeOwnerApprovalRequired This property is required. bool
Reject code pushes that change files listed in the CODEOWNERS file.
Id This property is required. int
The ID of this resource.
Name This property is required. string
The name of the protected branch.
MergeAccessLevels List<Pulumi.GitLab.Inputs.GetProjectProtectedBranchesProtectedBranchMergeAccessLevel>
Array of access levels and user(s)/group(s) allowed to merge to protected branch.
PushAccessLevels List<Pulumi.GitLab.Inputs.GetProjectProtectedBranchesProtectedBranchPushAccessLevel>
Array of access levels and user(s)/group(s) allowed to push to protected branch.
AllowForcePush This property is required. bool
Whether force push is allowed.
CodeOwnerApprovalRequired This property is required. bool
Reject code pushes that change files listed in the CODEOWNERS file.
Id This property is required. int
The ID of this resource.
Name This property is required. string
The name of the protected branch.
MergeAccessLevels []GetProjectProtectedBranchesProtectedBranchMergeAccessLevel
Array of access levels and user(s)/group(s) allowed to merge to protected branch.
PushAccessLevels []GetProjectProtectedBranchesProtectedBranchPushAccessLevel
Array of access levels and user(s)/group(s) allowed to push to protected branch.
allowForcePush This property is required. Boolean
Whether force push is allowed.
codeOwnerApprovalRequired This property is required. Boolean
Reject code pushes that change files listed in the CODEOWNERS file.
id This property is required. Integer
The ID of this resource.
name This property is required. String
The name of the protected branch.
mergeAccessLevels List<GetProjectProtectedBranchesProtectedBranchMergeAccessLevel>
Array of access levels and user(s)/group(s) allowed to merge to protected branch.
pushAccessLevels List<GetProjectProtectedBranchesProtectedBranchPushAccessLevel>
Array of access levels and user(s)/group(s) allowed to push to protected branch.
allowForcePush This property is required. boolean
Whether force push is allowed.
codeOwnerApprovalRequired This property is required. boolean
Reject code pushes that change files listed in the CODEOWNERS file.
id This property is required. number
The ID of this resource.
name This property is required. string
The name of the protected branch.
mergeAccessLevels GetProjectProtectedBranchesProtectedBranchMergeAccessLevel[]
Array of access levels and user(s)/group(s) allowed to merge to protected branch.
pushAccessLevels GetProjectProtectedBranchesProtectedBranchPushAccessLevel[]
Array of access levels and user(s)/group(s) allowed to push to protected branch.
allow_force_push This property is required. bool
Whether force push is allowed.
code_owner_approval_required This property is required. bool
Reject code pushes that change files listed in the CODEOWNERS file.
id This property is required. int
The ID of this resource.
name This property is required. str
The name of the protected branch.
merge_access_levels Sequence[GetProjectProtectedBranchesProtectedBranchMergeAccessLevel]
Array of access levels and user(s)/group(s) allowed to merge to protected branch.
push_access_levels Sequence[GetProjectProtectedBranchesProtectedBranchPushAccessLevel]
Array of access levels and user(s)/group(s) allowed to push to protected branch.
allowForcePush This property is required. Boolean
Whether force push is allowed.
codeOwnerApprovalRequired This property is required. Boolean
Reject code pushes that change files listed in the CODEOWNERS file.
id This property is required. Number
The ID of this resource.
name This property is required. String
The name of the protected branch.
mergeAccessLevels List<Property Map>
Array of access levels and user(s)/group(s) allowed to merge to protected branch.
pushAccessLevels List<Property Map>
Array of access levels and user(s)/group(s) allowed to push to protected branch.

GetProjectProtectedBranchesProtectedBranchMergeAccessLevel

AccessLevel This property is required. string
Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
AccessLevelDescription This property is required. string
Readable description of access level.
GroupId int
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
UserId int
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
AccessLevel This property is required. string
Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
AccessLevelDescription This property is required. string
Readable description of access level.
GroupId int
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
UserId int
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
accessLevel This property is required. String
Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
accessLevelDescription This property is required. String
Readable description of access level.
groupId Integer
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
userId Integer
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
accessLevel This property is required. string
Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
accessLevelDescription This property is required. string
Readable description of access level.
groupId number
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
userId number
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
access_level This property is required. str
Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
access_level_description This property is required. str
Readable description of access level.
group_id int
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
user_id int
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
accessLevel This property is required. String
Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
accessLevelDescription This property is required. String
Readable description of access level.
groupId Number
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
userId Number
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.

GetProjectProtectedBranchesProtectedBranchPushAccessLevel

AccessLevel This property is required. string
Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
AccessLevelDescription This property is required. string
Readable description of access level.
DeployKeyId int
The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with group_id and user_id. This field is read-only until Gitlab 17.5.
GroupId int
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with deploy_key_id and user_id.
UserId int
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with deploy_key_id and group_id.
AccessLevel This property is required. string
Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
AccessLevelDescription This property is required. string
Readable description of access level.
DeployKeyId int
The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with group_id and user_id. This field is read-only until Gitlab 17.5.
GroupId int
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with deploy_key_id and user_id.
UserId int
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with deploy_key_id and group_id.
accessLevel This property is required. String
Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
accessLevelDescription This property is required. String
Readable description of access level.
deployKeyId Integer
The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with group_id and user_id. This field is read-only until Gitlab 17.5.
groupId Integer
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with deploy_key_id and user_id.
userId Integer
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with deploy_key_id and group_id.
accessLevel This property is required. string
Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
accessLevelDescription This property is required. string
Readable description of access level.
deployKeyId number
The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with group_id and user_id. This field is read-only until Gitlab 17.5.
groupId number
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with deploy_key_id and user_id.
userId number
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with deploy_key_id and group_id.
access_level This property is required. str
Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
access_level_description This property is required. str
Readable description of access level.
deploy_key_id int
The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with group_id and user_id. This field is read-only until Gitlab 17.5.
group_id int
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with deploy_key_id and user_id.
user_id int
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with deploy_key_id and group_id.
accessLevel This property is required. String
Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
accessLevelDescription This property is required. String
Readable description of access level.
deployKeyId Number
The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with group_id and user_id. This field is read-only until Gitlab 17.5.
groupId Number
The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with deploy_key_id and user_id.
userId Number
The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with deploy_key_id and group_id.

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.