get Repository Pull Requests
Use this data source to retrieve information about multiple GitHub Pull Requests in a repository.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const example = github.getRepositoryPullRequests({
baseRepository: "example-repository",
baseRef: "main",
sortBy: "updated",
sortDirection: "desc",
state: "open",
});
import pulumi
import pulumi_github as github
example = github.get_repository_pull_requests(base_repository="example-repository",
base_ref="main",
sort_by="updated",
sort_direction="desc",
state="open")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var example = Github.GetRepositoryPullRequests.Invoke(new()
{
BaseRepository = "example-repository",
BaseRef = "main",
SortBy = "updated",
SortDirection = "desc",
State = "open",
});
});
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.LookupRepositoryPullRequests(ctx, &github.LookupRepositoryPullRequestsArgs{
BaseRepository: "example-repository",
BaseRef: pulumi.StringRef("main"),
SortBy: pulumi.StringRef("updated"),
SortDirection: pulumi.StringRef("desc"),
State: pulumi.StringRef("open"),
}, 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.GetRepositoryPullRequestsArgs;
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.getRepositoryPullRequests(GetRepositoryPullRequestsArgs.builder()
.baseRepository("example-repository")
.baseRef("main")
.sortBy("updated")
.sortDirection("desc")
.state("open")
.build());
}
}
variables:
example:
fn::invoke:
function: github:getRepositoryPullRequests
arguments:
baseRepository: example-repository
baseRef: main
sortBy: updated
sortDirection: desc
state: open
Return
A collection of values returned by getRepositoryPullRequests.
Parameters
A collection of arguments for invoking getRepositoryPullRequests.
Return
A collection of values returned by getRepositoryPullRequests.
Parameters
If set, filters Pull Requests by base branch name.
Name of the base repository to retrieve the Pull Requests from.
If set, filters Pull Requests by head user or head organization and branch name in the format of "user:ref-name" or "organization:ref-name". For example: "github:new-script-format" or "octocat:test-branch".
Owner of the repository. If not provided, the provider's default owner is used.
If set, indicates what to sort results by. Can be either "created", "updated", "popularity" (comment count) or "long-running" (age, filtering by pulls updated in the last month). Default: "created".
If set, controls the direction of the sort. Can be either "asc" or "desc". Default: "asc".
If set, filters Pull Requests by state. Can be "open", "closed", or "all". Default: "open".
See also
Return
A collection of values returned by getRepositoryPullRequests.
Parameters
Builder for com.pulumi.github.kotlin.inputs.GetRepositoryPullRequestsPlainArgs.