@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
146 lines (145 loc) • 4.84 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* 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
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const development = new github.Branch("development", {
* repository: "example",
* branch: "development",
* });
* ```
*
* ## Import
*
* GitHub Branch can be imported using an ID made up of `repository:branch`, e.g.
*
* ```sh
* $ pulumi import github:index/branch:Branch terraform terraform:main
* ```
* Importing github branch into an instance object (when using a for each block to manage multiple branches)
*
* ```sh
* $ pulumi import github:index/branch:Branch terraform["terraform"] terraform:main
* ```
* Optionally, a source branch may be specified using an ID of `repository:branch:source_branch`.
* This is useful for importing branches that do not branch directly off main.
*
* ```sh
* $ pulumi import github:index/branch:Branch terraform terraform:feature-branch:dev
* ```
*/
export declare class Branch extends pulumi.CustomResource {
/**
* Get an existing Branch resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BranchState, opts?: pulumi.CustomResourceOptions): Branch;
/**
* Returns true if the given object is an instance of Branch. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Branch;
/**
* The repository branch to create.
*/
readonly branch: pulumi.Output<string>;
/**
* An etag representing the Branch object.
*/
readonly etag: pulumi.Output<string>;
/**
* A string representing a branch reference, in the form of `refs/heads/<branch>`.
*/
readonly ref: pulumi.Output<string>;
/**
* The GitHub repository name.
*/
readonly repository: pulumi.Output<string>;
/**
* A string storing the reference's `HEAD` commit's SHA1.
*/
readonly sha: pulumi.Output<string>;
/**
* The branch name to start from. Defaults to `main`.
*/
readonly sourceBranch: pulumi.Output<string | undefined>;
/**
* The commit hash to start from. Defaults to the tip of `sourceBranch`. If provided, `sourceBranch` is ignored.
*/
readonly sourceSha: pulumi.Output<string>;
/**
* Create a Branch resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: BranchArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Branch resources.
*/
export interface BranchState {
/**
* The repository branch to create.
*/
branch?: pulumi.Input<string>;
/**
* An etag representing the Branch object.
*/
etag?: pulumi.Input<string>;
/**
* A string representing a branch reference, in the form of `refs/heads/<branch>`.
*/
ref?: pulumi.Input<string>;
/**
* The GitHub repository name.
*/
repository?: pulumi.Input<string>;
/**
* A string storing the reference's `HEAD` commit's SHA1.
*/
sha?: pulumi.Input<string>;
/**
* The branch name to start from. Defaults to `main`.
*/
sourceBranch?: pulumi.Input<string>;
/**
* The commit hash to start from. Defaults to the tip of `sourceBranch`. If provided, `sourceBranch` is ignored.
*/
sourceSha?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Branch resource.
*/
export interface BranchArgs {
/**
* The repository branch to create.
*/
branch: pulumi.Input<string>;
/**
* The GitHub repository name.
*/
repository: pulumi.Input<string>;
/**
* The branch name to start from. Defaults to `main`.
*/
sourceBranch?: pulumi.Input<string>;
/**
* The commit hash to start from. Defaults to the tip of `sourceBranch`. If provided, `sourceBranch` is ignored.
*/
sourceSha?: pulumi.Input<string>;
}