Class 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",
});
}
}
Inherited Members
Namespace: Pulumi.Github
Assembly: Pulumi.Github.dll
Syntax
public class Branch : CustomResource
Constructors
View SourceBranch(String, BranchArgs, CustomResourceOptions)
Create a Branch resource with the given unique name, arguments, and options.
Declaration
public Branch(string name, BranchArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| BranchArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceBranchName
The repository branch to create.
Declaration
public Output<string> BranchName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Etag
An etag representing the Branch object.
Declaration
public Output<string> Etag { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Ref
A string representing a branch reference, in the form of refs/heads/<branch>.
Declaration
public Output<string> Ref { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Repository
The GitHub repository name.
Declaration
public Output<string> Repository { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Sha
A string storing the reference's HEAD commit's SHA1.
Declaration
public Output<string> Sha { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceBranch
The branch name to start from. Defaults to master.
Declaration
public Output<string> SourceBranch { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceSha
The commit hash to start from. Defaults to the tip of source_branch. If provided, source_branch is ignored.
Declaration
public Output<string> SourceSha { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, BranchState, CustomResourceOptions)
Get an existing Branch resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Branch Get(string name, Input<string> id, BranchState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| BranchState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Branch |