RepositoryFileArgs

data class RepositoryFileArgs(val branch: Output<String>? = null, val commitAuthor: Output<String>? = null, val commitEmail: Output<String>? = null, val commitMessage: Output<String>? = null, val content: Output<String>? = null, val file: Output<String>? = null, val overwriteOnCreate: Output<Boolean>? = null, val repository: Output<String>? = null) : ConvertibleToJava<RepositoryFileArgs>

/* This resource allows you to create and manage files within a GitHub repository.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.RepositoryFile;
import com.pulumi.github.RepositoryFileArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var fooRepository = new Repository("fooRepository", RepositoryArgs.builder()
.autoInit(true)
.build());
var fooRepositoryFile = new RepositoryFile("fooRepositoryFile", RepositoryFileArgs.builder()
.repository(fooRepository.name())
.branch("main")
.file(".gitignore")
.content("**/*.tfstate")
.commitMessage("Managed by Terraform")
.commitAuthor("Terraform User")
.commitEmail("terraform@example.com")
.overwriteOnCreate(true)
.build());
}
}

Import

Repository files can be imported using a combination of the repo and file, e.g.

$ 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.

$ pulumi import github:index/repositoryFile:RepositoryFile gitignore example/.gitignore:dev

Constructors

Link copied to clipboard
constructor(branch: Output<String>? = null, commitAuthor: Output<String>? = null, commitEmail: Output<String>? = null, commitMessage: Output<String>? = null, content: Output<String>? = null, file: Output<String>? = null, overwriteOnCreate: Output<Boolean>? = null, repository: Output<String>? = null)

Properties

Link copied to clipboard
val branch: Output<String>? = null

Git branch (defaults to the repository's default branch). The branch must already exist, it will not be created if it does not already exist.

Link copied to clipboard
val commitAuthor: Output<String>? = null

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.

Link copied to clipboard
val commitEmail: Output<String>? = null

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.

Link copied to clipboard
val commitMessage: Output<String>? = null

Commit message when adding or updating the managed file.

Link copied to clipboard
val content: Output<String>? = null

The file content.

Link copied to clipboard
val file: Output<String>? = null

The path of the file to manage.

Link copied to clipboard
val overwriteOnCreate: Output<Boolean>? = null

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.

Link copied to clipboard
val repository: Output<String>? = null

The repository to create the file in.

Functions

Link copied to clipboard
open override fun toJava(): RepositoryFileArgs