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.
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. |
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. |
- 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."