Skip to content

Commit

Permalink
fix(workflows): change mentioned user in the PR review notification (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
medns authored and zoomchan-cxj committed Feb 6, 2023
1 parent f451461 commit 63af240
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/gh_pr_review_notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ jobs:
runs-on: ubuntu-latest
env:
MESSAGE: |
Hi, @${{ needs.call_get_workflow_output.outputs.sender }}.
I noticed that our reviewers requested changes to this pull request.
Hi, @{0}, I noticed that our reviewers requested changes to this pull request.
When you're done, **click the `Re-request review` button in the right sidebar(shown below)** to notify the reviewer.
![Re-request review button in the right sidebar](https://docs.github.com/assets/cb-4714/images/help/pull_requests/request-re-review.png)
steps:
Expand All @@ -98,13 +96,14 @@ jobs:
with open(os.getenv("GITHUB_OUTPUT"), 'w', encoding='utf-8') as file:
file.write("review_state=%s\n" % data["review"]["state"])
file.write("pull_request_number=%s\n" % data["pull_request"]["number"])
file.write("pull_request_user=%s\n" % data["pull_request"]["user"]["login"])
- name: Find
id: find_comment
if: steps.parse_workflow_output.outputs.review_state == 'changes_requested'
uses: peter-evans/[email protected]
with:
issue-number: ${{ steps.parse_workflow_output.outputs.pull_request_number }}
body-includes: ${{ env.MESSAGE }}
body-includes: ${{ format(env.MESSAGE, steps.parse_workflow_output.outputs.pull_request_user) }}
- name: Token
id: get-token
if: steps.find_comment.outputs.comment-id == '' && steps.parse_workflow_output.outputs.review_state == 'changes_requested'
Expand All @@ -118,5 +117,5 @@ jobs:
with:
token: ${{ steps.get-token.outputs.token }}
issue-number: ${{ steps.parse_workflow_output.outputs.pull_request_number }}
body: ${{ env.MESSAGE }}
body: ${{ format(env.MESSAGE, steps.parse_workflow_output.outputs.pull_request_user) }}
reactions: eyes

0 comments on commit 63af240

Please sign in to comment.