The Get Pull Request action retrieves detailed information of the specified pull request from a GitHub repository.

Overview

The Get Pull Request action retrieves the details of a pull request using the pull request number. The retrieved data includes the title, state, author, URL, branch, comments, additions, deletions, created date, base branch, merge status, review comments, mergeability status, changed files, commits, and merged by. The action requires an active GitHub session to authenticate the request.

Settings

The Get Pull Request action contains the following settings:

Note: All the input fields support string variables. You can create a string variable to hold the appropriate text string and select it in the applicable setting and option.
Session name

Specifies the GitHub session name that the Connect action creates. Use one of the following options to specify the session name:

  • Session name: Enter the session name as text directly or select the string variable that holds the session name text.
  • Variable: Select the GitHub session variable that the Connect action creates.
Owner name
Specifies the name of the GitHub repository owner. The owner can be an organization or a user account. You can either enter the name directly as text or select the applicable string variable.
Repository name
Specifies the name of the GitHub repository from which the action retrieves the pull request. You can either enter the repository name directly as text or select the applicable string variable.
Pull request number
Specifies the pull request number to retrieve details. You can either enter the pull request number directly as text or select the applicable string variable.
Assign output to variable
Specifies the variable in which the action stores the response data. The response data includes the following fields:
  • title - The title of the pull request.
  • state - The state of the pull request. The state can be open or closed.
  • author - The creator of the pull request.
  • url - The HTML URL of the pull request.
  • branch - The source branch for which the pull request is created.
  • comments - The number of comments in the pull request.
  • additions - The number of additions made to the code in the source branch.
  • deletions - The number of deletions made to the code in the source branch.
  • created - The timestamp indicating when the pull request was created.
  • baseBranch - The target branch into which the pull request must be merged.
  • merged - The boolean flag indicating the merge status of the pull request.
  • reviewComments - The number of review comments in the pull request. These are the inline comments added to the files within the source branch.
  • mergeable - The boolean indicating whether the pull request can be merged without any conflicts.
  • changedFiles - The number of changed files in the source branch of the pull request.
  • commits - The number of commits made in the pull request.
  • mergedBy - The user that merged the pull request to the target branch.
Use one of the following options to assign the output:
  • Multiple variables: Create and specify individual variables to store specific response data.

    Use the Add variable mapping option to specify the key and corresponding variable type to store the specific response data.

  • Dictionary: Create and specify a dictionary variable to store the entire response data. You can also select an existing dictionary variable.