RepositoryFile

class RepositoryFile : KotlinCustomResource

/* 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

Properties

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

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>?

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>?

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>

Commit message when adding or updating the managed file.

Link copied to clipboard
val commitSha: Output<String>

The SHA of the commit that modified the file.

Link copied to clipboard
val content: Output<String>

The file content.

Link copied to clipboard
val file: Output<String>

The path of the file to manage.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ref: Output<String>

The name of the commit/branch/tag.

Link copied to clipboard
val repository: Output<String>

The repository to create the file in.

Link copied to clipboard
val sha: Output<String>

The SHA blob of the file.

Link copied to clipboard
val urn: Output<String>