Skip to main content

Get a pull request

The GitHub Get a pull request action retrieves details for a single existing pull request in a connected GitHub repository. Use this read-only action to get structured pull request data for analysis, review, or documentation tasks.

Specify the pull request by owner, repository, and pull request number. The action works across any connected GitHub repositories, including private repositories, as long as the GitHub app is properly installed and the calling user has permission to view the pull request.

Limitations

  • Subject to GitHub API rate limits, along with any additional limits configured by your admin for GitHub actions.

  • Can operate only on repositories and pull requests that are accessible through GitHub app installation and permissions of your organization.

  • For private repositories, the GitHub app used for actions must be installed and authorized for the organization and for the specific repository. If that app is missing or not fully approved, calls to this action can return HTTP 404 Not Found even when the pull request exists.

Prerequisites

  • Your admin must install and configure the GitHub connector, add the GitHub actions pack under Admin > Actions, and enable this action.

  • A GitHub app must be installed on the relevant organization(s) and linked to the correct GitHub datasource in the Glean admin console.

  • You must authenticate for GitHub actions so the action can run using your GitHub identity.

Supported parameters

ParameterTypeDescription
OwnerStringOwner of the repository that contains the pull request.
Repository NameStringName of the repository that contains the pull request.
Pull Request NumberIntegerNumber of the pull request to retrieve details for.

Usage example

You want to review an important pull request that was just opened and need to see its details before deciding next steps.

Instruction to an agent:

"Get the details for pull request #127 in the mycompany/backend repository."

Resulting behavior:

  • Calls Get a pull request with:

    • Owner set to "mycompany".

    • Repository Name set to "backend".

    • Pull Request Number set to 127.

  • Retrieves pull request data including:

    • PR title and description

    • Author information

    • Base and head branches

    • Current state (open, closed, merged)

    • List of changed files

    • Commit count

    • Review status and comments

    • Labels and assignees

  • Presents the pull request details to the user.

  • User can review the information and decide whether to approve, request changes, or take other actions.

Workflow tip: Use this action as the first step in pull request review workflows. Combine it with other GitHub actions to build intelligent review agents that can summarize changes, leave targeted comments, or request specific reviewers based on the files changed.

Troubleshooting

FAQs