GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi
github.getRepositories
Explore with Pulumi AI
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({
query: "org:hashicorp language:Go",
includeRepoId: true,
});
import pulumi
import pulumi_github as github
example = github.get_repositories(query="org:hashicorp language:Go",
include_repo_id=True)
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{
Query: "org:hashicorp language:Go",
IncludeRepoId: pulumi.BoolRef(true),
}, 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()
{
Query = "org:hashicorp language:Go",
IncludeRepoId = true,
});
});
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()
.query("org:hashicorp language:Go")
.includeRepoId(true)
.build());
}
}
variables:
example:
fn::invoke:
Function: github:getRepositories
Arguments:
query: org:hashicorp language:Go
includeRepoId: true
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.
- Include
Repo boolId - Returns a list of found repository IDs
- Results
Per intPage - 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
, andupdated
. Defaults toupdated
.
- Query string
- Search query. See documentation for the search syntax.
- Include
Repo boolId - Returns a list of found repository IDs
- Results
Per intPage - 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
, andupdated
. Defaults toupdated
.
- query String
- Search query. See documentation for the search syntax.
- include
Repo BooleanId - Returns a list of found repository IDs
- results
Per IntegerPage - 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
, andupdated
. Defaults toupdated
.
- query string
- Search query. See documentation for the search syntax.
- include
Repo booleanId - Returns a list of found repository IDs
- results
Per numberPage - 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
, andupdated
. Defaults toupdated
.
- query str
- Search query. See documentation for the search syntax.
- include_
repo_ boolid - Returns a list of found repository IDs
- results_
per_ intpage - 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
, andupdated
. Defaults toupdated
.
- query String
- Search query. See documentation for the search syntax.
- include
Repo BooleanId - Returns a list of found repository IDs
- results
Per NumberPage - 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
, andupdated
. Defaults toupdated
.
getRepositories Result
The following output properties are available:
- Full
Names List<string> - Id string
- The provider-assigned unique ID for this managed resource.
- Names List<string>
- Query string
- Repo
Ids List<int> - (Optional) A list of found repository IDs (e.g.
449898861
) - Include
Repo boolId - Results
Per intPage - Sort string
- Full
Names []string - Id string
- The provider-assigned unique ID for this managed resource.
- Names []string
- Query string
- Repo
Ids []int - (Optional) A list of found repository IDs (e.g.
449898861
) - Include
Repo boolId - Results
Per intPage - Sort string
- full
Names List<String> - id String
- The provider-assigned unique ID for this managed resource.
- names List<String>
- query String
- repo
Ids List<Integer> - (Optional) A list of found repository IDs (e.g.
449898861
) - include
Repo BooleanId - results
Per IntegerPage - sort String
- full
Names string[] - id string
- The provider-assigned unique ID for this managed resource.
- names string[]
- query string
- repo
Ids number[] - (Optional) A list of found repository IDs (e.g.
449898861
) - include
Repo booleanId - results
Per numberPage - 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_ boolid - results_
per_ intpage - sort str
- full
Names List<String> - id String
- The provider-assigned unique ID for this managed resource.
- names List<String>
- query String
- repo
Ids List<Number> - (Optional) A list of found repository IDs (e.g.
449898861
) - include
Repo BooleanId - results
Per NumberPage - sort String
Package Details
- Repository
- GitHub pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
github
Terraform Provider.