1. Packages
  2. Packages
  3. Github Provider
  4. API Docs
  5. getRepository
Viewing docs for GitHub v4.17.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
github logo
Viewing docs for GitHub v4.17.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Use this data source to retrieve information about a GitHub repository.

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Github.GetRepository.Invoke(new()
        {
            FullName = "hashicorp/terraform",
        });
    
    });
    
    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.LookupRepository(ctx, &GetRepositoryArgs{
    			FullName: pulumi.StringRef("hashicorp/terraform"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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.GetRepositoryArgs;
    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 example = GithubFunctions.getRepository(GetRepositoryArgs.builder()
                .fullName("hashicorp/terraform")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = pulumi.output(github.getRepository({
        fullName: "hashicorp/terraform",
    }));
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_repository(full_name="hashicorp/terraform")
    
    variables:
      example:
        Fn::Invoke:
          Function: github:getRepository
          Arguments:
            fullName: hashicorp/terraform
    

    Using getRepository

    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 getRepository(args: GetRepositoryArgs, opts?: InvokeOptions): Promise<GetRepositoryResult>
    function getRepositoryOutput(args: GetRepositoryOutputArgs, opts?: InvokeOptions): Output<GetRepositoryResult>
    def get_repository(description: Optional[str] = None,
                       full_name: Optional[str] = None,
                       homepage_url: Optional[str] = None,
                       name: Optional[str] = None,
                       only_protected_branches: Optional[bool] = None,
                       opts: Optional[InvokeOptions] = None) -> GetRepositoryResult
    def get_repository_output(description: Optional[pulumi.Input[str]] = None,
                       full_name: Optional[pulumi.Input[str]] = None,
                       homepage_url: Optional[pulumi.Input[str]] = None,
                       name: Optional[pulumi.Input[str]] = None,
                       only_protected_branches: Optional[pulumi.Input[bool]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryResult]
    func LookupRepository(ctx *Context, args *LookupRepositoryArgs, opts ...InvokeOption) (*LookupRepositoryResult, error)
    func LookupRepositoryOutput(ctx *Context, args *LookupRepositoryOutputArgs, opts ...InvokeOption) LookupRepositoryResultOutput

    > Note: This function is named LookupRepository in the Go SDK.

    public static class GetRepository 
    {
        public static Task<GetRepositoryResult> InvokeAsync(GetRepositoryArgs args, InvokeOptions? opts = null)
        public static Output<GetRepositoryResult> Invoke(GetRepositoryInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRepositoryResult> getRepository(GetRepositoryArgs args, InvokeOptions options)
    public static Output<GetRepositoryResult> getRepository(GetRepositoryArgs args, InvokeOptions options)
    
    fn::invoke:
      function: github:index/getRepository:getRepository
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Description string
    A description of the repository.
    FullName string
    Full name of the repository (in org/name format).
    HomepageUrl string
    URL of a page describing the project.
    Name string
    The name of the repository.
    OnlyProtectedBranches bool
    . If true, the branches attributes will be populated only with protected branches. Default: false.
    Description string
    A description of the repository.
    FullName string
    Full name of the repository (in org/name format).
    HomepageUrl string
    URL of a page describing the project.
    Name string
    The name of the repository.
    OnlyProtectedBranches bool
    . If true, the branches attributes will be populated only with protected branches. Default: false.
    description String
    A description of the repository.
    fullName String
    Full name of the repository (in org/name format).
    homepageUrl String
    URL of a page describing the project.
    name String
    The name of the repository.
    onlyProtectedBranches Boolean
    . If true, the branches attributes will be populated only with protected branches. Default: false.
    description string
    A description of the repository.
    fullName string
    Full name of the repository (in org/name format).
    homepageUrl string
    URL of a page describing the project.
    name string
    The name of the repository.
    onlyProtectedBranches boolean
    . If true, the branches attributes will be populated only with protected branches. Default: false.
    description str
    A description of the repository.
    full_name str
    Full name of the repository (in org/name format).
    homepage_url str
    URL of a page describing the project.
    name str
    The name of the repository.
    only_protected_branches bool
    . If true, the branches attributes will be populated only with protected branches. Default: false.
    description String
    A description of the repository.
    fullName String
    Full name of the repository (in org/name format).
    homepageUrl String
    URL of a page describing the project.
    name String
    The name of the repository.
    onlyProtectedBranches Boolean
    . If true, the branches attributes will be populated only with protected branches. Default: false.

    getRepository Result

    The following output properties are available:

    AllowAutoMerge bool
    Whether the repository allows auto-merging pull requests.
    AllowMergeCommit bool
    Whether the repository allows merge commits.
    AllowRebaseMerge bool
    Whether the repository allows rebase merges.
    AllowSquashMerge bool
    Whether the repository allows squash merges.
    Archived bool
    Whether the repository is archived.
    Branches List<GetRepositoryBranch>
    The list of this repository's branches. Each element of branches has the following attributes:
    DefaultBranch string
    The name of the default branch of the repository.
    FullName string
    GitCloneUrl string
    URL that can be provided to git clone to clone the repository anonymously via the git protocol.
    HasDownloads bool
    Whether the repository has Downloads feature enabled.
    HasIssues bool
    Whether the repository has GitHub Issues enabled.
    HasProjects bool
    Whether the repository has the GitHub Projects enabled.
    HasWiki bool
    Whether the repository has the GitHub Wiki enabled.
    HtmlUrl string
    URL to the repository on the web.
    HttpCloneUrl string
    URL that can be provided to git clone to clone the repository via HTTPS.
    Id string
    The provider-assigned unique ID for this managed resource.
    MergeCommitMessage string
    The default value for a merge commit message.
    MergeCommitTitle string
    The default value for a merge commit title.
    Name string
    Name of the branch.
    NodeId string
    GraphQL global node id for use with v4 API
    Pages List<GetRepositoryPage>
    The repository's GitHub Pages configuration.
    Private bool
    Whether the repository is private.
    RepoId int
    GitHub ID for the repository
    SquashMergeCommitMessage string
    The default value for a squash merge commit message.
    SquashMergeCommitTitle string
    The default value for a squash merge commit title.
    SshCloneUrl string
    URL that can be provided to git clone to clone the repository via SSH.
    SvnUrl string
    URL that can be provided to svn checkout to check out the repository via GitHub's Subversion protocol emulation.
    Topics List<string>
    The list of topics of the repository.
    Visibility string
    Whether the repository is public, private or internal.
    Description string
    A description of the repository.
    HomepageUrl string
    URL of a page describing the project.
    OnlyProtectedBranches bool
    AllowAutoMerge bool
    Whether the repository allows auto-merging pull requests.
    AllowMergeCommit bool
    Whether the repository allows merge commits.
    AllowRebaseMerge bool
    Whether the repository allows rebase merges.
    AllowSquashMerge bool
    Whether the repository allows squash merges.
    Archived bool
    Whether the repository is archived.
    Branches []GetRepositoryBranch
    The list of this repository's branches. Each element of branches has the following attributes:
    DefaultBranch string
    The name of the default branch of the repository.
    FullName string
    GitCloneUrl string
    URL that can be provided to git clone to clone the repository anonymously via the git protocol.
    HasDownloads bool
    Whether the repository has Downloads feature enabled.
    HasIssues bool
    Whether the repository has GitHub Issues enabled.
    HasProjects bool
    Whether the repository has the GitHub Projects enabled.
    HasWiki bool
    Whether the repository has the GitHub Wiki enabled.
    HtmlUrl string
    URL to the repository on the web.
    HttpCloneUrl string
    URL that can be provided to git clone to clone the repository via HTTPS.
    Id string
    The provider-assigned unique ID for this managed resource.
    MergeCommitMessage string
    The default value for a merge commit message.
    MergeCommitTitle string
    The default value for a merge commit title.
    Name string
    Name of the branch.
    NodeId string
    GraphQL global node id for use with v4 API
    Pages []GetRepositoryPage
    The repository's GitHub Pages configuration.
    Private bool
    Whether the repository is private.
    RepoId int
    GitHub ID for the repository
    SquashMergeCommitMessage string
    The default value for a squash merge commit message.
    SquashMergeCommitTitle string
    The default value for a squash merge commit title.
    SshCloneUrl string
    URL that can be provided to git clone to clone the repository via SSH.
    SvnUrl string
    URL that can be provided to svn checkout to check out the repository via GitHub's Subversion protocol emulation.
    Topics []string
    The list of topics of the repository.
    Visibility string
    Whether the repository is public, private or internal.
    Description string
    A description of the repository.
    HomepageUrl string
    URL of a page describing the project.
    OnlyProtectedBranches bool
    allowAutoMerge Boolean
    Whether the repository allows auto-merging pull requests.
    allowMergeCommit Boolean
    Whether the repository allows merge commits.
    allowRebaseMerge Boolean
    Whether the repository allows rebase merges.
    allowSquashMerge Boolean
    Whether the repository allows squash merges.
    archived Boolean
    Whether the repository is archived.
    branches List<GetRepositoryBranch>
    The list of this repository's branches. Each element of branches has the following attributes:
    defaultBranch String
    The name of the default branch of the repository.
    fullName String
    gitCloneUrl String
    URL that can be provided to git clone to clone the repository anonymously via the git protocol.
    hasDownloads Boolean
    Whether the repository has Downloads feature enabled.
    hasIssues Boolean
    Whether the repository has GitHub Issues enabled.
    hasProjects Boolean
    Whether the repository has the GitHub Projects enabled.
    hasWiki Boolean
    Whether the repository has the GitHub Wiki enabled.
    htmlUrl String
    URL to the repository on the web.
    httpCloneUrl String
    URL that can be provided to git clone to clone the repository via HTTPS.
    id String
    The provider-assigned unique ID for this managed resource.
    mergeCommitMessage String
    The default value for a merge commit message.
    mergeCommitTitle String
    The default value for a merge commit title.
    name String
    Name of the branch.
    nodeId String
    GraphQL global node id for use with v4 API
    pages List<GetRepositoryPage>
    The repository's GitHub Pages configuration.
    private_ Boolean
    Whether the repository is private.
    repoId Integer
    GitHub ID for the repository
    squashMergeCommitMessage String
    The default value for a squash merge commit message.
    squashMergeCommitTitle String
    The default value for a squash merge commit title.
    sshCloneUrl String
    URL that can be provided to git clone to clone the repository via SSH.
    svnUrl String
    URL that can be provided to svn checkout to check out the repository via GitHub's Subversion protocol emulation.
    topics List<String>
    The list of topics of the repository.
    visibility String
    Whether the repository is public, private or internal.
    description String
    A description of the repository.
    homepageUrl String
    URL of a page describing the project.
    onlyProtectedBranches Boolean
    allowAutoMerge boolean
    Whether the repository allows auto-merging pull requests.
    allowMergeCommit boolean
    Whether the repository allows merge commits.
    allowRebaseMerge boolean
    Whether the repository allows rebase merges.
    allowSquashMerge boolean
    Whether the repository allows squash merges.
    archived boolean
    Whether the repository is archived.
    branches GetRepositoryBranch[]
    The list of this repository's branches. Each element of branches has the following attributes:
    defaultBranch string
    The name of the default branch of the repository.
    fullName string
    gitCloneUrl string
    URL that can be provided to git clone to clone the repository anonymously via the git protocol.
    hasDownloads boolean
    Whether the repository has Downloads feature enabled.
    hasIssues boolean
    Whether the repository has GitHub Issues enabled.
    hasProjects boolean
    Whether the repository has the GitHub Projects enabled.
    hasWiki boolean
    Whether the repository has the GitHub Wiki enabled.
    htmlUrl string
    URL to the repository on the web.
    httpCloneUrl string
    URL that can be provided to git clone to clone the repository via HTTPS.
    id string
    The provider-assigned unique ID for this managed resource.
    mergeCommitMessage string
    The default value for a merge commit message.
    mergeCommitTitle string
    The default value for a merge commit title.
    name string
    Name of the branch.
    nodeId string
    GraphQL global node id for use with v4 API
    pages GetRepositoryPage[]
    The repository's GitHub Pages configuration.
    private boolean
    Whether the repository is private.
    repoId number
    GitHub ID for the repository
    squashMergeCommitMessage string
    The default value for a squash merge commit message.
    squashMergeCommitTitle string
    The default value for a squash merge commit title.
    sshCloneUrl string
    URL that can be provided to git clone to clone the repository via SSH.
    svnUrl string
    URL that can be provided to svn checkout to check out the repository via GitHub's Subversion protocol emulation.
    topics string[]
    The list of topics of the repository.
    visibility string
    Whether the repository is public, private or internal.
    description string
    A description of the repository.
    homepageUrl string
    URL of a page describing the project.
    onlyProtectedBranches boolean
    allow_auto_merge bool
    Whether the repository allows auto-merging pull requests.
    allow_merge_commit bool
    Whether the repository allows merge commits.
    allow_rebase_merge bool
    Whether the repository allows rebase merges.
    allow_squash_merge bool
    Whether the repository allows squash merges.
    archived bool
    Whether the repository is archived.
    branches Sequence[GetRepositoryBranch]
    The list of this repository's branches. Each element of branches has the following attributes:
    default_branch str
    The name of the default branch of the repository.
    full_name str
    git_clone_url str
    URL that can be provided to git clone to clone the repository anonymously via the git protocol.
    has_downloads bool
    Whether the repository has Downloads feature enabled.
    has_issues bool
    Whether the repository has GitHub Issues enabled.
    has_projects bool
    Whether the repository has the GitHub Projects enabled.
    has_wiki bool
    Whether the repository has the GitHub Wiki enabled.
    html_url str
    URL to the repository on the web.
    http_clone_url str
    URL that can be provided to git clone to clone the repository via HTTPS.
    id str
    The provider-assigned unique ID for this managed resource.
    merge_commit_message str
    The default value for a merge commit message.
    merge_commit_title str
    The default value for a merge commit title.
    name str
    Name of the branch.
    node_id str
    GraphQL global node id for use with v4 API
    pages Sequence[GetRepositoryPage]
    The repository's GitHub Pages configuration.
    private bool
    Whether the repository is private.
    repo_id int
    GitHub ID for the repository
    squash_merge_commit_message str
    The default value for a squash merge commit message.
    squash_merge_commit_title str
    The default value for a squash merge commit title.
    ssh_clone_url str
    URL that can be provided to git clone to clone the repository via SSH.
    svn_url str
    URL that can be provided to svn checkout to check out the repository via GitHub's Subversion protocol emulation.
    topics Sequence[str]
    The list of topics of the repository.
    visibility str
    Whether the repository is public, private or internal.
    description str
    A description of the repository.
    homepage_url str
    URL of a page describing the project.
    only_protected_branches bool
    allowAutoMerge Boolean
    Whether the repository allows auto-merging pull requests.
    allowMergeCommit Boolean
    Whether the repository allows merge commits.
    allowRebaseMerge Boolean
    Whether the repository allows rebase merges.
    allowSquashMerge Boolean
    Whether the repository allows squash merges.
    archived Boolean
    Whether the repository is archived.
    branches List<Property Map>
    The list of this repository's branches. Each element of branches has the following attributes:
    defaultBranch String
    The name of the default branch of the repository.
    fullName String
    gitCloneUrl String
    URL that can be provided to git clone to clone the repository anonymously via the git protocol.
    hasDownloads Boolean
    Whether the repository has Downloads feature enabled.
    hasIssues Boolean
    Whether the repository has GitHub Issues enabled.
    hasProjects Boolean
    Whether the repository has the GitHub Projects enabled.
    hasWiki Boolean
    Whether the repository has the GitHub Wiki enabled.
    htmlUrl String
    URL to the repository on the web.
    httpCloneUrl String
    URL that can be provided to git clone to clone the repository via HTTPS.
    id String
    The provider-assigned unique ID for this managed resource.
    mergeCommitMessage String
    The default value for a merge commit message.
    mergeCommitTitle String
    The default value for a merge commit title.
    name String
    Name of the branch.
    nodeId String
    GraphQL global node id for use with v4 API
    pages List<Property Map>
    The repository's GitHub Pages configuration.
    private Boolean
    Whether the repository is private.
    repoId Number
    GitHub ID for the repository
    squashMergeCommitMessage String
    The default value for a squash merge commit message.
    squashMergeCommitTitle String
    The default value for a squash merge commit title.
    sshCloneUrl String
    URL that can be provided to git clone to clone the repository via SSH.
    svnUrl String
    URL that can be provided to svn checkout to check out the repository via GitHub's Subversion protocol emulation.
    topics List<String>
    The list of topics of the repository.
    visibility String
    Whether the repository is public, private or internal.
    description String
    A description of the repository.
    homepageUrl String
    URL of a page describing the project.
    onlyProtectedBranches Boolean

    Supporting Types

    GetRepositoryBranch

    Name string
    The name of the repository.
    Protected bool
    Whether the branch is protected.
    Name string
    The name of the repository.
    Protected bool
    Whether the branch is protected.
    name String
    The name of the repository.
    protected_ Boolean
    Whether the branch is protected.
    name string
    The name of the repository.
    protected boolean
    Whether the branch is protected.
    name str
    The name of the repository.
    protected bool
    Whether the branch is protected.
    name String
    The name of the repository.
    protected Boolean
    Whether the branch is protected.

    GetRepositoryPage

    Cname string
    Custom404 bool
    HtmlUrl string
    URL to the repository on the web.
    Sources List<GetRepositoryPageSource>
    Status string
    Url string
    Cname string
    Custom404 bool
    HtmlUrl string
    URL to the repository on the web.
    Sources []GetRepositoryPageSource
    Status string
    Url string
    cname String
    custom404 Boolean
    htmlUrl String
    URL to the repository on the web.
    sources List<GetRepositoryPageSource>
    status String
    url String
    cname string
    custom404 boolean
    htmlUrl string
    URL to the repository on the web.
    sources GetRepositoryPageSource[]
    status string
    url string
    cname str
    custom404 bool
    html_url str
    URL to the repository on the web.
    sources Sequence[GetRepositoryPageSource]
    status str
    url str
    cname String
    custom404 Boolean
    htmlUrl String
    URL to the repository on the web.
    sources List<Property Map>
    status String
    url String

    GetRepositoryPageSource

    Branch string
    Path string
    Branch string
    Path string
    branch String
    path String
    branch string
    path string
    branch str
    path str
    branch String
    path String

    Package Details

    Repository
    GitHub pulumi/pulumi-github
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the github Terraform Provider.
    github logo
    Viewing docs for GitHub v4.17.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.