We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f1d20f commit cf79f6eCopy full SHA for cf79f6e
1 file changed
.github/workflows/pull_request.yaml
@@ -1,5 +1,3 @@
1
-name: Pull Request
2
-
3
on:
4
pull_request_review:
5
types: [submitted]
@@ -12,7 +10,7 @@ jobs:
12
10
- name: Count Approved Reviews
13
11
run: |
14
APPROVED_COUNT=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \
15
- --jq '[.[] | select(.state == "APPROVED")] | length')
+ --jq 'group_by(.user.login) | map(last) | map(select(.state == "APPROVED")) | length')
16
17
echo "Number of Approved Reviews: $APPROVED_COUNT"
18
@@ -22,4 +20,4 @@ jobs:
22
20
echo "PR has only $APPROVED_COUNT approved reviews. Waiting for more approvals."
23
21
fi
24
env:
25
- GH_TOKEN: ${{ secrets.SUPER_SECRET }}
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
0 commit comments