import * as pulumi from "@pulumi/pulumi"; /** * This resource allows you to create and manage files within a * GitHub repository. * * > **Note:** When a repository is archived, Terraform will skip deletion of repository files to avoid API errors, as archived repositories are read-only. The files will be removed from Terraform state without attempting to delete them from GitHub. * * ## Example Usage * * ### Existing Branch * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const foo = new github.Repository("foo", { * name: "example", * 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: "example", * 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`, `file` and `branch` or empty branch for the default branch, e.g. * * ```sh * $ pulumi import github:index/repositoryFile:RepositoryFile gitignore example:.gitignore:feature-branch * ``` * * and using default branch: * * ```sh * $ pulumi import github:index/repositoryFile:RepositoryFile gitignore example:.gitignore: * ``` */ 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; /** * **Deprecated** 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'. Use the `github.Branch` resource instead. * * @deprecated Use `github.Branch` resource instead */ readonly autocreateBranch: pulumi.Output; /** * **Deprecated** The branch name to start from, if 'autocreate_branch' is set. Defaults to 'main'. Use the `github.Branch` resource instead. * * @deprecated Use `github.Branch` resource instead */ readonly autocreateBranchSourceBranch: pulumi.Output; /** * **Deprecated** 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. Use the `github.Branch` resource instead. * * @deprecated Use `github.Branch` resource instead */ 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 ID of the repository. */ readonly repositoryId: 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 { /** * **Deprecated** 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'. Use the `github.Branch` resource instead. * * @deprecated Use `github.Branch` resource instead */ autocreateBranch?: pulumi.Input; /** * **Deprecated** The branch name to start from, if 'autocreate_branch' is set. Defaults to 'main'. Use the `github.Branch` resource instead. * * @deprecated Use `github.Branch` resource instead */ autocreateBranchSourceBranch?: pulumi.Input; /** * **Deprecated** 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. Use the `github.Branch` resource instead. * * @deprecated Use `github.Branch` resource instead */ 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 ID of the repository. */ repositoryId?: pulumi.Input; /** * The SHA blob of the file. */ sha?: pulumi.Input; } /** * The set of arguments for constructing a RepositoryFile resource. */ export interface RepositoryFileArgs { /** * **Deprecated** 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'. Use the `github.Branch` resource instead. * * @deprecated Use `github.Branch` resource instead */ autocreateBranch?: pulumi.Input; /** * **Deprecated** The branch name to start from, if 'autocreate_branch' is set. Defaults to 'main'. Use the `github.Branch` resource instead. * * @deprecated Use `github.Branch` resource instead */ autocreateBranchSourceBranch?: pulumi.Input; /** * **Deprecated** 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. Use the `github.Branch` resource instead. * * @deprecated Use `github.Branch` resource instead */ 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; } //# sourceMappingURL=repositoryFile.d.ts.map