Skip to content

Commit

Permalink
Add PR reviewer set action
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Jun 23, 2023
1 parent 842921e commit 4ac3c65
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/pr_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check for reviewer

on:
pull_request:
types: [ opened, reopened, ready_for_review ]

jobs:
check_reviewer_set:
runs-on: ubuntu-latest

# Check if a reviewer has been set and add a comment if not
steps:
- name: Check For Reviewer
id: reviewer_check
run: |
echo "Reviewers: ${{ github.event.pull_request.requested_reviewers }}"
if [ -z "${{ github.event.pull_request.requested_reviewers }}" ]; then
echo "No reviewer set. Adding a bot message on PR"
fi
- name: Add comment to PR
uses: mshick/add-pr-comment@v2
if: steps.reviewer_check.outputs.result == 'No reviewer set. Adding a bot message on PR'
with:
message: |
@${{ github.event.pull_request.user.login }} please [set a reviewer for this PR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) or it will not be looked at by a maintainer.

0 comments on commit 4ac3c65

Please sign in to comment.