import * as pulumi from "@pulumi/pulumi"; /** * This resource allows you to create and manage files within a * GitHub repository. * * ## Example Usage * * ### Existing Branch * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const foo = new github.Repository("foo", { * name: "tf-acc-test-%s", * autoInit: true, * }); * const fooRepositoryFile = new github.RepositoryFile("foo", { * repository: foo.name, * branch: "main", * file: ".gitignore", * content: "**/*.tfstate", * commitMessage: "Managed by Pulumi", * commitAuthor: "Terraform User", * commitEmail: "terraform@example.com", * overwriteOnCreate: true, * }); * ``` * * ### Auto Created Branch * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const foo = new github.Repository("foo", { * name: "tf-acc-test-%s", * autoInit: true, * }); * const fooRepositoryFile = new github.RepositoryFile("foo", { * repository: foo.name, * branch: "does/not/exist", * file: ".gitignore", * content: "**/*.tfstate", * commitMessage: "Managed by Pulumi", * commitAuthor: "Terraform User", * commitEmail: "terraform@example.com", * overwriteOnCreate: true, * autocreateBranch: true, * }); * ``` * * ## Import * * Repository files can be imported using a combination of the `repo` and `file`, e.g. * * ```sh * $ pulumi import github:index/repositoryFile:RepositoryFile gitignore example/.gitignore * ``` * To import a file from a branch other than the default branch, append `:` and the branch name, e.g. * * ```sh * $ pulumi import github:index/repositoryFile:RepositoryFile gitignore example/.gitignore:dev * ``` */ export declare class RepositoryFile extends pulumi.CustomResource { /** * Get an existing RepositoryFile 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?: RepositoryFileState, opts?: pulumi.CustomResourceOptions): RepositoryFile; /** * Returns true if the given object is an instance of RepositoryFile. 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 RepositoryFile; /** * Automatically create the branch if it could not be found. Defaults to false. Subsequent reads if the branch is deleted will occur from 'autocreate_branch_source_branch'. */ readonly autocreateBranch: pulumi.Output; /** * The branch name to start from, if 'autocreate_branch' is set. Defaults to 'main'. */ readonly autocreateBranchSourceBranch: pulumi.Output; /** * The commit hash to start from, if 'autocreate_branch' is set. Defaults to the tip of 'autocreate_branch_source_branch'. If provided, 'autocreate_branch_source_branch' is ignored. */ readonly autocreateBranchSourceSha: pulumi.Output; /** * Git branch (defaults to the repository's default branch). * The branch must already exist, it will only be created automatically if 'autocreate_branch' is set true. */ readonly branch: pulumi.Output; /** * Committer author name to use. **NOTE:** GitHub app users may omit author and email information so GitHub can verify commits as the GitHub App. This maybe useful when a branch protection rule requires signed commits. */ readonly commitAuthor: pulumi.Output; /** * Committer email address to use. **NOTE:** GitHub app users may omit author and email information so GitHub can verify commits as the GitHub App. This may be useful when a branch protection rule requires signed commits. */ readonly commitEmail: pulumi.Output; /** * The commit message when creating, updating or deleting the managed file. */ readonly commitMessage: pulumi.Output; /** * The SHA of the commit that modified the file. */ readonly commitSha: pulumi.Output; /** * The file content. */ readonly content: pulumi.Output; /** * The path of the file to manage. */ readonly file: pulumi.Output; /** * Enable overwriting existing files. If set to `true` it will overwrite an existing file with the same name. If set to `false` it will fail if there is an existing file with the same name. */ readonly overwriteOnCreate: pulumi.Output; /** * The name of the commit/branch/tag. */ readonly ref: pulumi.Output; /** * The repository to create the file in. */ readonly repository: pulumi.Output; /** * The SHA blob of the file. */ readonly sha: pulumi.Output; /** * Create a RepositoryFile 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: RepositoryFileArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RepositoryFile resources. */ export interface RepositoryFileState { /** * Automatically create the branch if it could not be found. Defaults to false. Subsequent reads if the branch is deleted will occur from 'autocreate_branch_source_branch'. */ autocreateBranch?: pulumi.Input; /** * The branch name to start from, if 'autocreate_branch' is set. Defaults to 'main'. */ autocreateBranchSourceBranch?: pulumi.Input; /** * The commit hash to start from, if 'autocreate_branch' is set. Defaults to the tip of 'autocreate_branch_source_branch'. If provided, 'autocreate_branch_source_branch' is ignored. */ autocreateBranchSourceSha?: pulumi.Input; /** * Git branch (defaults to the repository's default branch). * The branch must already exist, it will only be created automatically if 'autocreate_branch' is set true. */ branch?: pulumi.Input; /** * Committer author name to use. **NOTE:** GitHub app users may omit author and email information so GitHub can verify commits as the GitHub App. This maybe useful when a branch protection rule requires signed commits. */ commitAuthor?: pulumi.Input; /** * Committer email address to use. **NOTE:** GitHub app users may omit author and email information so GitHub can verify commits as the GitHub App. This may be useful when a branch protection rule requires signed commits. */ commitEmail?: pulumi.Input; /** * The commit message when creating, updating or deleting the managed file. */ commitMessage?: pulumi.Input; /** * The SHA of the commit that modified the file. */ commitSha?: pulumi.Input; /** * The file content. */ content?: pulumi.Input; /** * The path of the file to manage. */ file?: pulumi.Input; /** * Enable overwriting existing files. If set to `true` it will overwrite an existing file with the same name. If set to `false` it will fail if there is an existing file with the same name. */ overwriteOnCreate?: pulumi.Input; /** * The name of the commit/branch/tag. */ ref?: pulumi.Input; /** * The repository to create the file in. */ repository?: pulumi.Input; /** * The SHA blob of the file. */ sha?: pulumi.Input; } /** * The set of arguments for constructing a RepositoryFile resource. */ export interface RepositoryFileArgs { /** * Automatically create the branch if it could not be found. Defaults to false. Subsequent reads if the branch is deleted will occur from 'autocreate_branch_source_branch'. */ autocreateBranch?: pulumi.Input; /** * The branch name to start from, if 'autocreate_branch' is set. Defaults to 'main'. */ autocreateBranchSourceBranch?: pulumi.Input; /** * The commit hash to start from, if 'autocreate_branch' is set. Defaults to the tip of 'autocreate_branch_source_branch'. If provided, 'autocreate_branch_source_branch' is ignored. */ autocreateBranchSourceSha?: pulumi.Input; /** * Git branch (defaults to the repository's default branch). * The branch must already exist, it will only be created automatically if 'autocreate_branch' is set true. */ branch?: pulumi.Input; /** * Committer author name to use. **NOTE:** GitHub app users may omit author and email information so GitHub can verify commits as the GitHub App. This maybe useful when a branch protection rule requires signed commits. */ commitAuthor?: pulumi.Input; /** * Committer email address to use. **NOTE:** GitHub app users may omit author and email information so GitHub can verify commits as the GitHub App. This may be useful when a branch protection rule requires signed commits. */ commitEmail?: pulumi.Input; /** * The commit message when creating, updating or deleting the managed file. */ commitMessage?: pulumi.Input; /** * The file content. */ content: pulumi.Input; /** * The path of the file to manage. */ file: pulumi.Input; /** * Enable overwriting existing files. If set to `true` it will overwrite an existing file with the same name. If set to `false` it will fail if there is an existing file with the same name. */ overwriteOnCreate?: pulumi.Input; /** * The repository to create the file in. */ repository: pulumi.Input; }