Branch

This resource allows you to create and manage branches within your repository.

Additional constraints can be applied to ensure your branch is created from another branch or commit.

Example Usage

using Pulumi;
using Github = Pulumi.Github;

class MyStack : Stack
{
    public MyStack()
    {
        var development = new Github.Branch("development", new Github.BranchArgs
        {
            Branch = "development",
            Repository = "example",
        });
    }

}

Coming soon!

import pulumi
import pulumi_github as github

development = github.Branch("development",
    branch="development",
    repository="example")
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";

const development = new github.Branch("development", {
    branch: "development",
    repository: "example",
});

Create a Branch Resource

new Branch(name: string, args: BranchArgs, opts?: CustomResourceOptions);
def Branch(resource_name, opts=None, branch=None, repository=None, source_branch=None, source_sha=None, __props__=None);
func NewBranch(ctx *Context, name string, args BranchArgs, opts ...ResourceOption) (*Branch, error)
public Branch(string name, BranchArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args BranchArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args BranchArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BranchArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Branch Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Branch resource accepts the following input properties:

BranchName string

The repository branch to create.

Repository string

The GitHub repository name.

SourceBranch string

The branch name to start from. Defaults to master.

SourceSha string

The commit hash to start from. Defaults to the tip of source_branch. If provided, source_branch is ignored.

Branch string

The repository branch to create.

Repository string

The GitHub repository name.

SourceBranch string

The branch name to start from. Defaults to master.

SourceSha string

The commit hash to start from. Defaults to the tip of source_branch. If provided, source_branch is ignored.

branch string

The repository branch to create.

repository string

The GitHub repository name.

sourceBranch string

The branch name to start from. Defaults to master.

sourceSha string

The commit hash to start from. Defaults to the tip of source_branch. If provided, source_branch is ignored.

branch str

The repository branch to create.

repository str

The GitHub repository name.

source_branch str

The branch name to start from. Defaults to master.

source_sha str

The commit hash to start from. Defaults to the tip of source_branch. If provided, source_branch is ignored.

Outputs

All input properties are implicitly available as output properties. Additionally, the Branch resource produces the following output properties:

Etag string

An etag representing the Branch object.

Id string
The provider-assigned unique ID for this managed resource.
Ref string

A string representing a branch reference, in the form of refs/heads/<branch>.

Sha string

A string storing the reference’s HEAD commit’s SHA1.

Etag string

An etag representing the Branch object.

Id string
The provider-assigned unique ID for this managed resource.
Ref string

A string representing a branch reference, in the form of refs/heads/<branch>.

Sha string

A string storing the reference’s HEAD commit’s SHA1.

etag string

An etag representing the Branch object.

id string
The provider-assigned unique ID for this managed resource.
ref string

A string representing a branch reference, in the form of refs/heads/<branch>.

sha string

A string storing the reference’s HEAD commit’s SHA1.

etag str

An etag representing the Branch object.

id str
The provider-assigned unique ID for this managed resource.
ref str

A string representing a branch reference, in the form of refs/heads/<branch>.

sha str

A string storing the reference’s HEAD commit’s SHA1.

Look up an Existing Branch Resource

Get an existing Branch resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: BranchState, opts?: CustomResourceOptions): Branch
static get(resource_name, id, opts=None, branch=None, etag=None, ref=None, repository=None, sha=None, source_branch=None, source_sha=None, __props__=None);
func GetBranch(ctx *Context, name string, id IDInput, state *BranchState, opts ...ResourceOption) (*Branch, error)
public static Branch Get(string name, Input<string> id, BranchState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

BranchName string

The repository branch to create.

Etag string

An etag representing the Branch object.

Ref string

A string representing a branch reference, in the form of refs/heads/<branch>.

Repository string

The GitHub repository name.

Sha string

A string storing the reference’s HEAD commit’s SHA1.

SourceBranch string

The branch name to start from. Defaults to master.

SourceSha string

The commit hash to start from. Defaults to the tip of source_branch. If provided, source_branch is ignored.

Branch string

The repository branch to create.

Etag string

An etag representing the Branch object.

Ref string

A string representing a branch reference, in the form of refs/heads/<branch>.

Repository string

The GitHub repository name.

Sha string

A string storing the reference’s HEAD commit’s SHA1.

SourceBranch string

The branch name to start from. Defaults to master.

SourceSha string

The commit hash to start from. Defaults to the tip of source_branch. If provided, source_branch is ignored.

branch string

The repository branch to create.

etag string

An etag representing the Branch object.

ref string

A string representing a branch reference, in the form of refs/heads/<branch>.

repository string

The GitHub repository name.

sha string

A string storing the reference’s HEAD commit’s SHA1.

sourceBranch string

The branch name to start from. Defaults to master.

sourceSha string

The commit hash to start from. Defaults to the tip of source_branch. If provided, source_branch is ignored.

branch str

The repository branch to create.

etag str

An etag representing the Branch object.

ref str

A string representing a branch reference, in the form of refs/heads/<branch>.

repository str

The GitHub repository name.

sha str

A string storing the reference’s HEAD commit’s SHA1.

source_branch str

The branch name to start from. Defaults to master.

source_sha str

The commit hash to start from. Defaults to the tip of source_branch. If provided, source_branch is ignored.

Package Details

Repository
https://github.com/pulumi/pulumi-github
License
Apache-2.0
Notes
This Pulumi package is based on the github Terraform Provider.