-
Notifications
You must be signed in to change notification settings - Fork 74
33 lines (29 loc) · 1.07 KB
/
check_count.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
name: Check Review
on:
pull_request:
types: [opened, edited, reopened, synchronize]
pull_request_review:
types: [edited, dismissed, submitted]
jobs:
check_review:
runs-on: ubuntu-latest
steps:
- name: review_count
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
IS_CONTAIN: ${{ contains(github.event.pull_request.labels.*.name, 'Need Review') }}
id: review_count
run: |
review=$(curl -s -H "Accept: application/vnd.github.black-cat-preview+json" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \
| jq '[ .[] | select(.state=="APPROVED") | .user.login ] | unique | length')
echo "Number of approved review_count: $review"
echo "CONTAIN=$IS_CONTAIN"
mkdir -p ./pr
echo $PR_NUMBER > ./pr/pr_number
echo $review > ./pr/review_num
echo $IS_CONTAIN > ./pr/contain_bool
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr/