GitHub
getRepositoryFile
This data source allows you to read files within a GitHub repository.
Example Usage
using Pulumi;
using Github = Pulumi.Github;
class MyStack : Stack
{
public MyStack()
{
var foo = Output.Create(Github.GetRepositoryFile.InvokeAsync(new Github.GetRepositoryFileArgs
{
Repository = github_repository.Foo.Name,
Branch = "main",
File = ".gitignore",
}));
}
}
package main
import (
"github.com/pulumi/pulumi-github/sdk/v4/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := github.LookupRepositoryFile(ctx, &GetRepositoryFileArgs{
Repository: github_repository.Foo.Name,
Branch: pulumi.StringRef("main"),
File: ".gitignore",
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_github as github
foo = github.get_repository_file(repository=github_repository["foo"]["name"],
branch="main",
file=".gitignore")
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const foo = github.getRepositoryFile({
repository: github_repository.foo.name,
branch: "main",
file: ".gitignore",
});
Coming soon!
Using getRepositoryFile
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRepositoryFile(args: GetRepositoryFileArgs, opts?: InvokeOptions): Promise<GetRepositoryFileResult>
function getRepositoryFileOutput(args: GetRepositoryFileOutputArgs, opts?: InvokeOptions): Output<GetRepositoryFileResult>
def get_repository_file(branch: Optional[str] = None,
file: Optional[str] = None,
repository: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRepositoryFileResult
def get_repository_file_output(branch: Optional[pulumi.Input[str]] = None,
file: Optional[pulumi.Input[str]] = None,
repository: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryFileResult]
func LookupRepositoryFile(ctx *Context, args *LookupRepositoryFileArgs, opts ...InvokeOption) (*LookupRepositoryFileResult, error)
func LookupRepositoryFileOutput(ctx *Context, args *LookupRepositoryFileOutputArgs, opts ...InvokeOption) LookupRepositoryFileResultOutput
> Note: This function is named LookupRepositoryFile
in the Go SDK.
public static class GetRepositoryFile
{
public static Task<GetRepositoryFileResult> InvokeAsync(GetRepositoryFileArgs args, InvokeOptions? opts = null)
public static Output<GetRepositoryFileResult> Invoke(GetRepositoryFileInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRepositoryFileResult> getRepositoryFile(GetRepositoryFileArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: github:index/getRepositoryFile:getRepositoryFile
Arguments:
# Arguments dictionary
The following arguments are supported:
- File string
The path of the file to manage.
- Repository string
The repository to create the file in.
- Branch string
Git branch (defaults to
main
). The branch must already exist, it will not be created if it does not already exist.
- File string
The path of the file to manage.
- Repository string
The repository to create the file in.
- Branch string
Git branch (defaults to
main
). The branch must already exist, it will not be created if it does not already exist.
- file String
The path of the file to manage.
- repository String
The repository to create the file in.
- branch String
Git branch (defaults to
main
). The branch must already exist, it will not be created if it does not already exist.
- file string
The path of the file to manage.
- repository string
The repository to create the file in.
- branch string
Git branch (defaults to
main
). The branch must already exist, it will not be created if it does not already exist.
- file str
The path of the file to manage.
- repository str
The repository to create the file in.
- branch str
Git branch (defaults to
main
). The branch must already exist, it will not be created if it does not already exist.
- file String
The path of the file to manage.
- repository String
The repository to create the file in.
- branch String
Git branch (defaults to
main
). The branch must already exist, it will not be created if it does not already exist.
getRepositoryFile Result
The following output properties are available:
- string
Committer author name.
- Commit
Email string Committer email address.
- Commit
Message string Commit message when file was last updated.
- Commit
Sha string The SHA of the commit that modified the file.
- Content string
The file content.
- File string
- Id string
The provider-assigned unique ID for this managed resource.
- Repository string
- Sha string
The SHA blob of the file.
- Branch string
- string
Committer author name.
- Commit
Email string Committer email address.
- Commit
Message string Commit message when file was last updated.
- Commit
Sha string The SHA of the commit that modified the file.
- Content string
The file content.
- File string
- Id string
The provider-assigned unique ID for this managed resource.
- Repository string
- Sha string
The SHA blob of the file.
- Branch string
- String
Committer author name.
- commit
Email String Committer email address.
- commit
Message String Commit message when file was last updated.
- commit
Sha String The SHA of the commit that modified the file.
- content String
The file content.
- file String
- id String
The provider-assigned unique ID for this managed resource.
- repository String
- sha String
The SHA blob of the file.
- branch String
- string
Committer author name.
- commit
Email string Committer email address.
- commit
Message string Commit message when file was last updated.
- commit
Sha string The SHA of the commit that modified the file.
- content string
The file content.
- file string
- id string
The provider-assigned unique ID for this managed resource.
- repository string
- sha string
The SHA blob of the file.
- branch string
- str
Committer author name.
- commit_
email str Committer email address.
- commit_
message str Commit message when file was last updated.
- commit_
sha str The SHA of the commit that modified the file.
- content str
The file content.
- file str
- id str
The provider-assigned unique ID for this managed resource.
- repository str
- sha str
The SHA blob of the file.
- branch str
- String
Committer author name.
- commit
Email String Committer email address.
- commit
Message String Commit message when file was last updated.
- commit
Sha String The SHA of the commit that modified the file.
- content String
The file content.
- file String
- id String
The provider-assigned unique ID for this managed resource.
- repository String
- sha String
The SHA blob of the file.
- branch String
Package Details
- Repository
- https://github.com/pulumi/pulumi-github
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
github
Terraform Provider.