1. Packages
  2. GitHub
  3. API Docs
  4. getRepositories
GitHub v6.1.0 published on Monday, Mar 11, 2024 by Pulumi

github.getRepositories

Explore with Pulumi AI

github logo
GitHub v6.1.0 published on Monday, Mar 11, 2024 by Pulumi

    Note: The data source will return a maximum of 1000 repositories as documented in official API docs.

    Use this data source to retrieve a list of GitHub repositories using a search query.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = github.getRepositories({
        includeRepoId: true,
        query: "org:hashicorp language:Go",
    });
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_repositories(include_repo_id=True,
        query="org:hashicorp language:Go")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := github.GetRepositories(ctx, &github.GetRepositoriesArgs{
    			IncludeRepoId: pulumi.BoolRef(true),
    			Query:         "org:hashicorp language:Go",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Github.GetRepositories.Invoke(new()
        {
            IncludeRepoId = true,
            Query = "org:hashicorp language:Go",
        });
    
    });
    
    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.GetRepositoriesArgs;
    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.getRepositories(GetRepositoriesArgs.builder()
                .includeRepoId(true)
                .query("org:hashicorp language:Go")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: github:getRepositories
          Arguments:
            includeRepoId: true
            query: org:hashicorp language:Go
    

    Using getRepositories

    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 getRepositories(args: GetRepositoriesArgs, opts?: InvokeOptions): Promise<GetRepositoriesResult>
    function getRepositoriesOutput(args: GetRepositoriesOutputArgs, opts?: InvokeOptions): Output<GetRepositoriesResult>
    def get_repositories(include_repo_id: Optional[bool] = None,
                         query: Optional[str] = None,
                         results_per_page: Optional[int] = None,
                         sort: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetRepositoriesResult
    def get_repositories_output(include_repo_id: Optional[pulumi.Input[bool]] = None,
                         query: Optional[pulumi.Input[str]] = None,
                         results_per_page: Optional[pulumi.Input[int]] = None,
                         sort: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetRepositoriesResult]
    func GetRepositories(ctx *Context, args *GetRepositoriesArgs, opts ...InvokeOption) (*GetRepositoriesResult, error)
    func GetRepositoriesOutput(ctx *Context, args *GetRepositoriesOutputArgs, opts ...InvokeOption) GetRepositoriesResultOutput

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

    public static class GetRepositories 
    {
        public static Task<GetRepositoriesResult> InvokeAsync(GetRepositoriesArgs args, InvokeOptions? opts = null)
        public static Output<GetRepositoriesResult> Invoke(GetRepositoriesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRepositoriesResult> getRepositories(GetRepositoriesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: github:index/getRepositories:getRepositories
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Query string
    Search query. See documentation for the search syntax.
    IncludeRepoId bool
    Returns a list of found repository IDs
    ResultsPerPage int
    Set the number of repositories requested per API call. Can be useful to decrease if requests are timing out or to increase to reduce the number of API calls. Defaults to 100.
    Sort string
    Sorts the repositories returned by the specified attribute. Valid values include stars, fork, and updated. Defaults to updated.
    Query string
    Search query. See documentation for the search syntax.
    IncludeRepoId bool
    Returns a list of found repository IDs
    ResultsPerPage int
    Set the number of repositories requested per API call. Can be useful to decrease if requests are timing out or to increase to reduce the number of API calls. Defaults to 100.
    Sort string
    Sorts the repositories returned by the specified attribute. Valid values include stars, fork, and updated. Defaults to updated.
    query String
    Search query. See documentation for the search syntax.
    includeRepoId Boolean
    Returns a list of found repository IDs
    resultsPerPage Integer
    Set the number of repositories requested per API call. Can be useful to decrease if requests are timing out or to increase to reduce the number of API calls. Defaults to 100.
    sort String
    Sorts the repositories returned by the specified attribute. Valid values include stars, fork, and updated. Defaults to updated.
    query string
    Search query. See documentation for the search syntax.
    includeRepoId boolean
    Returns a list of found repository IDs
    resultsPerPage number
    Set the number of repositories requested per API call. Can be useful to decrease if requests are timing out or to increase to reduce the number of API calls. Defaults to 100.
    sort string
    Sorts the repositories returned by the specified attribute. Valid values include stars, fork, and updated. Defaults to updated.
    query str
    Search query. See documentation for the search syntax.
    include_repo_id bool
    Returns a list of found repository IDs
    results_per_page int
    Set the number of repositories requested per API call. Can be useful to decrease if requests are timing out or to increase to reduce the number of API calls. Defaults to 100.
    sort str
    Sorts the repositories returned by the specified attribute. Valid values include stars, fork, and updated. Defaults to updated.
    query String
    Search query. See documentation for the search syntax.
    includeRepoId Boolean
    Returns a list of found repository IDs
    resultsPerPage Number
    Set the number of repositories requested per API call. Can be useful to decrease if requests are timing out or to increase to reduce the number of API calls. Defaults to 100.
    sort String
    Sorts the repositories returned by the specified attribute. Valid values include stars, fork, and updated. Defaults to updated.

    getRepositories Result

    The following output properties are available:

    FullNames List<string>
    Id string
    The provider-assigned unique ID for this managed resource.
    Names List<string>
    Query string
    RepoIds List<int>
    (Optional) A list of found repository IDs (e.g. 449898861)
    IncludeRepoId bool
    ResultsPerPage int
    Sort string
    FullNames []string
    Id string
    The provider-assigned unique ID for this managed resource.
    Names []string
    Query string
    RepoIds []int
    (Optional) A list of found repository IDs (e.g. 449898861)
    IncludeRepoId bool
    ResultsPerPage int
    Sort string
    fullNames List<String>
    id String
    The provider-assigned unique ID for this managed resource.
    names List<String>
    query String
    repoIds List<Integer>
    (Optional) A list of found repository IDs (e.g. 449898861)
    includeRepoId Boolean
    resultsPerPage Integer
    sort String
    fullNames string[]
    id string
    The provider-assigned unique ID for this managed resource.
    names string[]
    query string
    repoIds number[]
    (Optional) A list of found repository IDs (e.g. 449898861)
    includeRepoId boolean
    resultsPerPage number
    sort string
    full_names Sequence[str]
    id str
    The provider-assigned unique ID for this managed resource.
    names Sequence[str]
    query str
    repo_ids Sequence[int]
    (Optional) A list of found repository IDs (e.g. 449898861)
    include_repo_id bool
    results_per_page int
    sort str
    fullNames List<String>
    id String
    The provider-assigned unique ID for this managed resource.
    names List<String>
    query String
    repoIds List<Number>
    (Optional) A list of found repository IDs (e.g. 449898861)
    includeRepoId Boolean
    resultsPerPage Number
    sort 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
    GitHub v6.1.0 published on Monday, Mar 11, 2024 by Pulumi