get Repository File
This data source allows you to read 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.GithubFunctions;
import com.pulumi.github.inputs.GetRepositoryFileArgs;
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) {
final var foo = GithubFunctions.getRepositoryFile(GetRepositoryFileArgs.builder()
.repository(github_repository.foo().name())
.branch("main")
.file(".gitignore")
.build());
}
}
Return
A collection of values returned by getRepositoryFile.
Parameters
A collection of arguments for invoking getRepositoryFile.
Return
A collection of values returned by getRepositoryFile.
Parameters
Git branch. Defaults to the repository's default branch.
The path of the file to read.
The repository to read the file from. If an unqualified repo name (without an owner) is passed, the owner will be inferred from the owner of the token used to execute the plan. If a name of the type "owner/repo" (with a slash in the middle) is passed, the owner will be as specified and not the owner of the token.
See also
Return
A collection of values returned by getRepositoryFile.
Parameters
Builder for com.pulumi.github.kotlin.inputs.GetRepositoryFilePlainArgs.