-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (32 loc) · 963 Bytes
/
review.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Check PR Reviewers and Assignments
on:
pull_request:
types:
- opened
- synchronize
- edited
- reopened
jobs:
check_pr:
runs-on: ubuntu-latest
steps:
- name: Check for Reviewers
id: reviewers
run: |
reviewers=$(jq -r '.pull_request.requested_reviewers | length' "$GITHUB_EVENT_PATH")
echo "Reviewers: $reviewers"
if [[ $reviewers -eq 0 ]]; then
echo "Error: The PR has no reviewers."
echo "::set-output name=has_reviewers::false"
else
echo "::set-output name=has_reviewers::true"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check for Assignees
run: |
assignees=$(jq -r '.pull_request.assignees | length' "$GITHUB_EVENT_PATH")
if [[ $assignees -eq 0 ]]; then
echo "Error: The PR has no assignees."
exit 1
fi