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

github.getRepositoryPullRequest

Explore with Pulumi AI

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

    Use this data source to retrieve information about a specific GitHub Pull Request in a repository.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = github.getRepositoryPullRequest({
        baseRepository: "example_repository",
        number: 1,
    });
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_repository_pull_request(base_repository="example_repository",
        number=1)
    
    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.LookupRepositoryPullRequest(ctx, &github.LookupRepositoryPullRequestArgs{
    			BaseRepository: "example_repository",
    			Number:         1,
    		}, 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.GetRepositoryPullRequest.Invoke(new()
        {
            BaseRepository = "example_repository",
            Number = 1,
        });
    
    });
    
    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.GetRepositoryPullRequestArgs;
    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.getRepositoryPullRequest(GetRepositoryPullRequestArgs.builder()
                .baseRepository("example_repository")
                .number(1)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: github:getRepositoryPullRequest
          Arguments:
            baseRepository: example_repository
            number: 1
    

    Using getRepositoryPullRequest

    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 getRepositoryPullRequest(args: GetRepositoryPullRequestArgs, opts?: InvokeOptions): Promise<GetRepositoryPullRequestResult>
    function getRepositoryPullRequestOutput(args: GetRepositoryPullRequestOutputArgs, opts?: InvokeOptions): Output<GetRepositoryPullRequestResult>
    def get_repository_pull_request(base_repository: Optional[str] = None,
                                    number: Optional[int] = None,
                                    owner: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetRepositoryPullRequestResult
    def get_repository_pull_request_output(base_repository: Optional[pulumi.Input[str]] = None,
                                    number: Optional[pulumi.Input[int]] = None,
                                    owner: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryPullRequestResult]
    func LookupRepositoryPullRequest(ctx *Context, args *LookupRepositoryPullRequestArgs, opts ...InvokeOption) (*LookupRepositoryPullRequestResult, error)
    func LookupRepositoryPullRequestOutput(ctx *Context, args *LookupRepositoryPullRequestOutputArgs, opts ...InvokeOption) LookupRepositoryPullRequestResultOutput

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

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

    The following arguments are supported:

    BaseRepository string
    Name of the base repository to retrieve the Pull Request from.
    Number int
    The number of the Pull Request within the repository.
    Owner string
    Owner of the repository. If not provided, the provider's default owner is used.
    BaseRepository string
    Name of the base repository to retrieve the Pull Request from.
    Number int
    The number of the Pull Request within the repository.
    Owner string
    Owner of the repository. If not provided, the provider's default owner is used.
    baseRepository String
    Name of the base repository to retrieve the Pull Request from.
    number Integer
    The number of the Pull Request within the repository.
    owner String
    Owner of the repository. If not provided, the provider's default owner is used.
    baseRepository string
    Name of the base repository to retrieve the Pull Request from.
    number number
    The number of the Pull Request within the repository.
    owner string
    Owner of the repository. If not provided, the provider's default owner is used.
    base_repository str
    Name of the base repository to retrieve the Pull Request from.
    number int
    The number of the Pull Request within the repository.
    owner str
    Owner of the repository. If not provided, the provider's default owner is used.
    baseRepository String
    Name of the base repository to retrieve the Pull Request from.
    number Number
    The number of the Pull Request within the repository.
    owner String
    Owner of the repository. If not provided, the provider's default owner is used.

    getRepositoryPullRequest Result

    The following output properties are available:

    BaseRef string
    Name of the ref (branch) of the Pull Request base.
    BaseRepository string
    BaseSha string
    Head commit SHA of the Pull Request base.
    Body string
    Body of the Pull Request.
    Draft bool
    Indicates Whether this Pull Request is a draft.
    HeadOwner string
    Owner of the Pull Request head repository.
    HeadRef string
    HeadRepository string
    Name of the Pull Request head repository.
    HeadSha string
    Head commit SHA of the Pull Request head.
    Id string
    The provider-assigned unique ID for this managed resource.
    Labels List<string>
    List of label names set on the Pull Request.
    MaintainerCanModify bool
    Indicates whether the base repository maintainers can modify the Pull Request.
    Number int
    OpenedAt int
    Unix timestamp indicating the Pull Request creation time.
    OpenedBy string
    GitHub login of the user who opened the Pull Request.
    State string
    the current Pull Request state - can be "open", "closed" or "merged".
    Title string
    The title of the Pull Request.
    UpdatedAt int
    The timestamp of the last Pull Request update.
    Owner string
    BaseRef string
    Name of the ref (branch) of the Pull Request base.
    BaseRepository string
    BaseSha string
    Head commit SHA of the Pull Request base.
    Body string
    Body of the Pull Request.
    Draft bool
    Indicates Whether this Pull Request is a draft.
    HeadOwner string
    Owner of the Pull Request head repository.
    HeadRef string
    HeadRepository string
    Name of the Pull Request head repository.
    HeadSha string
    Head commit SHA of the Pull Request head.
    Id string
    The provider-assigned unique ID for this managed resource.
    Labels []string
    List of label names set on the Pull Request.
    MaintainerCanModify bool
    Indicates whether the base repository maintainers can modify the Pull Request.
    Number int
    OpenedAt int
    Unix timestamp indicating the Pull Request creation time.
    OpenedBy string
    GitHub login of the user who opened the Pull Request.
    State string
    the current Pull Request state - can be "open", "closed" or "merged".
    Title string
    The title of the Pull Request.
    UpdatedAt int
    The timestamp of the last Pull Request update.
    Owner string
    baseRef String
    Name of the ref (branch) of the Pull Request base.
    baseRepository String
    baseSha String
    Head commit SHA of the Pull Request base.
    body String
    Body of the Pull Request.
    draft Boolean
    Indicates Whether this Pull Request is a draft.
    headOwner String
    Owner of the Pull Request head repository.
    headRef String
    headRepository String
    Name of the Pull Request head repository.
    headSha String
    Head commit SHA of the Pull Request head.
    id String
    The provider-assigned unique ID for this managed resource.
    labels List<String>
    List of label names set on the Pull Request.
    maintainerCanModify Boolean
    Indicates whether the base repository maintainers can modify the Pull Request.
    number Integer
    openedAt Integer
    Unix timestamp indicating the Pull Request creation time.
    openedBy String
    GitHub login of the user who opened the Pull Request.
    state String
    the current Pull Request state - can be "open", "closed" or "merged".
    title String
    The title of the Pull Request.
    updatedAt Integer
    The timestamp of the last Pull Request update.
    owner String
    baseRef string
    Name of the ref (branch) of the Pull Request base.
    baseRepository string
    baseSha string
    Head commit SHA of the Pull Request base.
    body string
    Body of the Pull Request.
    draft boolean
    Indicates Whether this Pull Request is a draft.
    headOwner string
    Owner of the Pull Request head repository.
    headRef string
    headRepository string
    Name of the Pull Request head repository.
    headSha string
    Head commit SHA of the Pull Request head.
    id string
    The provider-assigned unique ID for this managed resource.
    labels string[]
    List of label names set on the Pull Request.
    maintainerCanModify boolean
    Indicates whether the base repository maintainers can modify the Pull Request.
    number number
    openedAt number
    Unix timestamp indicating the Pull Request creation time.
    openedBy string
    GitHub login of the user who opened the Pull Request.
    state string
    the current Pull Request state - can be "open", "closed" or "merged".
    title string
    The title of the Pull Request.
    updatedAt number
    The timestamp of the last Pull Request update.
    owner string
    base_ref str
    Name of the ref (branch) of the Pull Request base.
    base_repository str
    base_sha str
    Head commit SHA of the Pull Request base.
    body str
    Body of the Pull Request.
    draft bool
    Indicates Whether this Pull Request is a draft.
    head_owner str
    Owner of the Pull Request head repository.
    head_ref str
    head_repository str
    Name of the Pull Request head repository.
    head_sha str
    Head commit SHA of the Pull Request head.
    id str
    The provider-assigned unique ID for this managed resource.
    labels Sequence[str]
    List of label names set on the Pull Request.
    maintainer_can_modify bool
    Indicates whether the base repository maintainers can modify the Pull Request.
    number int
    opened_at int
    Unix timestamp indicating the Pull Request creation time.
    opened_by str
    GitHub login of the user who opened the Pull Request.
    state str
    the current Pull Request state - can be "open", "closed" or "merged".
    title str
    The title of the Pull Request.
    updated_at int
    The timestamp of the last Pull Request update.
    owner str
    baseRef String
    Name of the ref (branch) of the Pull Request base.
    baseRepository String
    baseSha String
    Head commit SHA of the Pull Request base.
    body String
    Body of the Pull Request.
    draft Boolean
    Indicates Whether this Pull Request is a draft.
    headOwner String
    Owner of the Pull Request head repository.
    headRef String
    headRepository String
    Name of the Pull Request head repository.
    headSha String
    Head commit SHA of the Pull Request head.
    id String
    The provider-assigned unique ID for this managed resource.
    labels List<String>
    List of label names set on the Pull Request.
    maintainerCanModify Boolean
    Indicates whether the base repository maintainers can modify the Pull Request.
    number Number
    openedAt Number
    Unix timestamp indicating the Pull Request creation time.
    openedBy String
    GitHub login of the user who opened the Pull Request.
    state String
    the current Pull Request state - can be "open", "closed" or "merged".
    title String
    The title of the Pull Request.
    updatedAt Number
    The timestamp of the last Pull Request update.
    owner 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