Branch
The gitlab.Branch
resource allows to manage the lifecycle of a repository branch. Upstream API: GitLab REST API docs
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.Branch;
import com.pulumi.gitlab.BranchArgs;
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) {
var exampleProject = new Project("exampleProject", ProjectArgs.builder()
.description("An example project")
.namespaceId(gitlab_group.example().id())
.build());
var exampleBranch = new Branch("exampleBranch", BranchArgs.builder()
.ref("main")
.project(exampleProject.id())
.build());
}
}
Content copied to clipboard
Import
Gitlab protected branches can be imported with a key composed of <project_id>:<branch_name>
, e.g.
$ pulumi import gitlab:index/branch:Branch example "12345:develop"
Content copied to clipboard
Properties
Link copied to clipboard
The commit associated with the branch ref.
Link copied to clipboard
Bool, true if developer level access allows to merge branch.
Link copied to clipboard
Bool, true if developer level access allows git push.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard