We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc13452 commit d4361f6Copy full SHA for d4361f6
1 file changed
.github/workflows/pull_request.yaml
@@ -0,0 +1,23 @@
1
+name: Pull Request
2
+
3
+on:
4
+ pull_request_review:
5
+ types: [submitted]
6
7
+jobs:
8
+ check_status:
9
+ if: github.event.review.state != 'approved'
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Count Approved Reviews
13
+ run: |
14
+ APPROVED_COUNT=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \
15
+ --jq '[.[] | select(.state == "APPROVED")] | length')
16
17
+ echo "Number of Approved Reviews: $APPROVED_COUNT"
18
19
+ if [ "$APPROVED_COUNT" -ge 2 ]; then
20
+ echo "PR has $APPROVED_COUNT approved reviews!"
21
+ else
22
+ echo "PR has only $APPROVED_COUNT approved reviews. Waiting for more approvals."
23
+ fi
0 commit comments