BranchDefaultArgs

data class BranchDefaultArgs(val branch: Output<String>? = null, val rename: Output<Boolean>? = null, val repository: Output<String>? = null) : ConvertibleToJava<BranchDefaultArgs>

Provides a GitHub branch default resource. This resource allows you to set the default branch for a given repository. Note that use of this resource is incompatible with the default_branch option of the github.Repository resource. Using both will result in plans always showing a diff.

Example Usage

Basic usage:

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.Branch;
import com.pulumi.github.BranchArgs;
import com.pulumi.github.BranchDefault;
import com.pulumi.github.BranchDefaultArgs;
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 example = new Repository("example", RepositoryArgs.builder()
.description("My awesome codebase")
.autoInit(true)
.build());
var development = new Branch("development", BranchArgs.builder()
.repository(example.name())
.branch("development")
.build());
var default_ = new BranchDefault("default", BranchDefaultArgs.builder()
.repository(example.name())
.branch(development.branch())
.build());
}
}

Import

GitHub Branch Defaults can be imported using an ID made up of repository, e.g.

$ pulumi import github:index/branchDefault:BranchDefault branch_default my-repo

Constructors

Link copied to clipboard
constructor(branch: Output<String>? = null, rename: Output<Boolean>? = null, repository: Output<String>? = null)

Properties

Link copied to clipboard
val branch: Output<String>? = null

The branch (e.g. main)

Link copied to clipboard
val rename: Output<Boolean>? = null

Indicate if it should rename the branch rather than use an existing branch. Defaults to false.

Link copied to clipboard
val repository: Output<String>? = null

The GitHub repository

Functions

Link copied to clipboard
open override fun toJava(): BranchDefaultArgs