Skip to content

Commit d4361f6

Browse files
committed
feat(pull-request): pr approved status
Signed-off-by: kapdroid <kapilsharma130519@gmail.com>
1 parent dc13452 commit d4361f6

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)