Skip to content

Check for Two Reviews #9

Check for Two Reviews

Check for Two Reviews #9

name: Check for Two Reviews
on:
pull_request_review:
types:
- edited
- dismissed
- submitted
branches:
- main
jobs:
check-reviews:
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- name: Get review counts
id: reviews
uses: jrylan/github-action-reviews-counter@main
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Fail if insufficient reviews
if: github.actor != 'dependabot[bot]' && (steps.reviews.outputs.approved < 2 || steps.reviews.outputs.changes_requested > 0)
run: |
echo "Needs at least 2 approvals and no changes requested (since you aren't Dependabot!)"
exit 1