Skip to main content
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

  • Possible cause: The owner, repo, or pull_number values do not match an existing pull request that is available through your GitHub connector.
  • Fix: Confirm that the repository is connected in Glean, the pull request exists in GitHub, and the identifiers you passed (owner, repo, pull request number) match the pull request you want to retrieve.
  • Possible cause: You are hitting GitHub API rate limits.
  • Fix: Reduce how frequently the action is called or stagger calls across workflows. If this keeps happening, contact your Glean admin to review configuration and usage.
  • Possible cause: GitHub actions are not enabled for your organization, you have not authenticated for GitHub actions, or your GitHub identity does not have permission to read pull requests for the target repository.
  • Fix: Ask your Glean admin to confirm that the GitHub actions pack is added and that you are allowed to use it, then re-authenticate for GitHub and try again.
  • Possible cause: The GitHub app used for actions is not installed or not authorized for the organization or for the specific (often private) repository, even though the pull request exists.
  • Fix: Verify that the correct GitHub app for actions is installed and approved at the organization level and has access to the target repository. After updating the app configuration, re-authenticate for GitHub actions and retry.

FAQs

Yes, as long as the GitHub app used for actions is installed and authorized for your organization and has access to the private repository.
The action runs using the identity that authenticated for GitHub actions. Make sure that identity has permission to view the target repository and pull request.