Class PullRequestResource

Represents a GitHub pull request resource with chainable async methods.

Implements PromiseLike<GitHubPullRequest> so it can be awaited directly to fetch the pull request info, while also exposing sub-resource methods.

// Await directly to get pull request info
const pr = await gh.org('github').repo('linguist').pullRequest(42);

// Get commits in this pull request
const commits = await gh.org('github').repo('linguist').pullRequest(42).commits();

// Get changed files
const files = await gh.org('github').repo('linguist').pullRequest(42).files();

// Get reviews
const reviews = await gh.org('github').repo('linguist').pullRequest(42).reviews();

// Get review comments (inline diff comments)
const comments = await gh.org('github').repo('linguist').pullRequest(42).reviewComments();

Implements

Methods

  • Checks whether the pull request has been merged.

    GET /repos/{owner}/{repo}/pulls/{pull_number}/merge

    Returns Promise<boolean>

    true if merged (HTTP 204), false if not merged (HTTP 404)