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, 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; /** * An etag representing the Branch object. */ readonly etag: pulumi.Output; /** * A string representing a branch reference, in the form of `refs/heads/`. */ readonly ref: pulumi.Output; /** * The GitHub repository name. */ readonly repository: pulumi.Output; /** * A string storing the reference's `HEAD` commit's SHA1. */ readonly sha: pulumi.Output; /** * The branch name to start from. Defaults to `main`. */ readonly sourceBranch: pulumi.Output; /** * The commit hash to start from. Defaults to the tip of `sourceBranch`. If provided, `sourceBranch` is ignored. */ readonly sourceSha: pulumi.Output; /** * 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; /** * An etag representing the Branch object. */ etag?: pulumi.Input; /** * A string representing a branch reference, in the form of `refs/heads/`. */ ref?: pulumi.Input; /** * The GitHub repository name. */ repository?: pulumi.Input; /** * A string storing the reference's `HEAD` commit's SHA1. */ sha?: pulumi.Input; /** * The branch name to start from. Defaults to `main`. */ sourceBranch?: pulumi.Input; /** * The commit hash to start from. Defaults to the tip of `sourceBranch`. If provided, `sourceBranch` is ignored. */ sourceSha?: pulumi.Input; } /** * The set of arguments for constructing a Branch resource. */ export interface BranchArgs { /** * The repository branch to create. */ branch: pulumi.Input; /** * The GitHub repository name. */ repository: pulumi.Input; /** * The branch name to start from. Defaults to `main`. */ sourceBranch?: pulumi.Input; /** * The commit hash to start from. Defaults to the tip of `sourceBranch`. If provided, `sourceBranch` is ignored. */ sourceSha?: pulumi.Input; }