getProjectProtectedBranch

The gitlab.getProjectProtectedBranch data source allows details of a protected branch to be retrieved by its name and the project it belongs to. Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const example = gitlab.getProjectProtectedBranch({
name: "main",
projectId: "foo/bar/baz",
});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.get_project_protected_branch(name="main",
project_id="foo/bar/baz")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var example = GitLab.GetProjectProtectedBranch.Invoke(new()
{
Name = "main",
ProjectId = "foo/bar/baz",
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.GetProjectProtectedBranch(ctx, &gitlab.GetProjectProtectedBranchArgs{
Name: "main",
ProjectId: "foo/bar/baz",
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetProjectProtectedBranchArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = GitlabFunctions.getProjectProtectedBranch(GetProjectProtectedBranchArgs.builder()
.name("main")
.projectId("foo/bar/baz")
.build());
}
}
variables:
example:
fn::invoke:
Function: gitlab:getProjectProtectedBranch
Arguments:
name: main
projectId: foo/bar/baz

Return

A collection of values returned by getProjectProtectedBranch.

Parameters

argument

A collection of arguments for invoking getProjectProtectedBranch.


Return

A collection of values returned by getProjectProtectedBranch.

Parameters

mergeAccessLevels

Array of access levels and user(s)/group(s) allowed to merge to protected branch.

name

The name of the protected branch.

projectId

The integer or path with namespace that uniquely identifies the project.

pushAccessLevels

Array of access levels and user(s)/group(s) allowed to push to protected branch.

See also


Return

A collection of values returned by getProjectProtectedBranch.

Parameters

argument

Builder for com.pulumi.gitlab.kotlin.inputs.GetProjectProtectedBranchPlainArgs.

See also