@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
131 lines (130 loc) • 4.26 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Provides a GitHub branch default resource.
*
* This resource allows you to set the default branch for a given repository.
*
* Note that use of this resource is incompatible with the `defaultBranch` option of the `github.Repository` resource. Using both will result in plans always showing a diff.
*
* ## Example Usage
*
* Basic usage:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const example = new github.Repository("example", {
* name: "example",
* description: "My awesome codebase",
* autoInit: true,
* });
* const development = new github.Branch("development", {
* repository: example.name,
* branch: "development",
* });
* const _default = new github.BranchDefault("default", {
* repository: example.name,
* branch: development.branch,
* });
* ```
*
* Renaming to a branch that doesn't exist:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const example = new github.Repository("example", {
* name: "example",
* description: "My awesome codebase",
* autoInit: true,
* });
* const _default = new github.BranchDefault("default", {
* repository: example.name,
* branch: "development",
* rename: true,
* });
* ```
*
* ## Import
*
* GitHub Branch Defaults can be imported using an ID made up of `repository`, e.g.
*
* ```sh
* $ pulumi import github:index/branchDefault:BranchDefault branch_default my-repo
* ```
*/
export declare class BranchDefault extends pulumi.CustomResource {
/**
* Get an existing BranchDefault 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?: BranchDefaultState, opts?: pulumi.CustomResourceOptions): BranchDefault;
/**
* Returns true if the given object is an instance of BranchDefault. 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 BranchDefault;
/**
* The branch (e.g. `main`)
*/
readonly branch: pulumi.Output<string>;
readonly etag: pulumi.Output<string>;
/**
* Indicate if it should rename the branch rather than use an existing branch. Defaults to `false`.
*/
readonly rename: pulumi.Output<boolean | undefined>;
/**
* The GitHub repository
*/
readonly repository: pulumi.Output<string>;
/**
* Create a BranchDefault 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: BranchDefaultArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering BranchDefault resources.
*/
export interface BranchDefaultState {
/**
* The branch (e.g. `main`)
*/
branch?: pulumi.Input<string>;
etag?: pulumi.Input<string>;
/**
* Indicate if it should rename the branch rather than use an existing branch. Defaults to `false`.
*/
rename?: pulumi.Input<boolean>;
/**
* The GitHub repository
*/
repository?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a BranchDefault resource.
*/
export interface BranchDefaultArgs {
/**
* The branch (e.g. `main`)
*/
branch: pulumi.Input<string>;
/**
* Indicate if it should rename the branch rather than use an existing branch. Defaults to `false`.
*/
rename?: pulumi.Input<boolean>;
/**
* The GitHub repository
*/
repository: pulumi.Input<string>;
}