Skip to content

Find Merged Pull Request

Actions
Finds and gets details about the pull request that was merged for current commit
v1
Latest
Star (0)

Tags

 (1)

benlei/find-merged-pull-request

GitHub Super-Linter CI Check dist/ CodeQL Coverage

This action can be used to try to match the current commit of the running workflow to a closed (merged) pull request. This can be useful for workflows where you need information about the pull request that was just merged but can't use the pull_request event due to the limitations around the event.

Inputs

Name Required Default Description
token no ${{ github.token }} GitHub token to use for API requests.
page-limit no 1 The maximum number of pages to search for a matching pull request.

Outputs

Name Description
number The number of the pull request that was merged.
title The title of the pull request that was merged.
body The body of the pull request that was merged.
labels The labels of the pull request that was merged, separated by commas.
labels-json The labels of the pull request that was merged, in JSON format.
user The user that opened the pull request that was merged.
assignees The assignees of the pull request that was merged, separated by commas.
assignees-json The assignees of the pull request that was merged, in JSON format.
milestone The milestone of the pull request that was merged.
merged_by The user that merged the pull request that was merged.

Example usage

- name: Get merged pull request
  id: merged
  uses: benlei/find-merged-pull-request@v1
  with:
    token: ${{ secrets.GITHUB_TOKEN }}

- name: Send a message if the merged pull request contains a 'fix' label
  if: ${{ contains(fromJSON(steps.merged.outputs.labels-json), 'fix') }}
  run: echo "The merged pull request contains a 'fix' label."

Find Merged Pull Request is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Finds and gets details about the pull request that was merged for current commit
v1
Latest

Tags

 (1)

Find Merged Pull Request is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.