From 4ac3c65dd61a587c7e857f30563f8ab5b53d254d Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Fri, 23 Jun 2023 08:46:06 -0600 Subject: [PATCH] Add PR reviewer set action Signed-off-by: Travis F. Collins --- .github/workflows/pr_review.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/pr_review.yml diff --git a/.github/workflows/pr_review.yml b/.github/workflows/pr_review.yml new file mode 100644 index 000000000..c3f75734c --- /dev/null +++ b/.github/workflows/pr_review.yml @@ -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.