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:
- Branch
Name string The repository branch to create.
- Repository string
The GitHub repository name.
- Source
Branch string The branch name to start from. Defaults to
master.- Source
Sha string The commit hash to start from. Defaults to the tip of
source_branch. If provided,source_branchis ignored.
- Branch string
The repository branch to create.
- Repository string
The GitHub repository name.
- Source
Branch string The branch name to start from. Defaults to
master.- Source
Sha string The commit hash to start from. Defaults to the tip of
source_branch. If provided,source_branchis ignored.
- branch string
The repository branch to create.
- repository string
The GitHub repository name.
- source
Branch string The branch name to start from. Defaults to
master.- source
Sha string The commit hash to start from. Defaults to the tip of
source_branch. If provided,source_branchis 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_branchis ignored.
Outputs
All input properties are implicitly available as output properties. Additionally, the Branch resource produces the following output properties:
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): Branchstatic 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:
- Branch
Name 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
HEADcommit’s SHA1.- Source
Branch string The branch name to start from. Defaults to
master.- Source
Sha string The commit hash to start from. Defaults to the tip of
source_branch. If provided,source_branchis 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
HEADcommit’s SHA1.- Source
Branch string The branch name to start from. Defaults to
master.- Source
Sha string The commit hash to start from. Defaults to the tip of
source_branch. If provided,source_branchis 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
HEADcommit’s SHA1.- source
Branch string The branch name to start from. Defaults to
master.- source
Sha string The commit hash to start from. Defaults to the tip of
source_branch. If provided,source_branchis 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
HEADcommit’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_branchis ignored.
Package Details
- Repository
- https://github.com/pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
githubTerraform Provider.