Skip to content

Add workflow to check for required reviews #1

Add workflow to check for required reviews

Add workflow to check for required reviews #1

name: Check required reviews
on:
pull_request:
types: [labeled]
pull_request_review:
types: [submitted]
jobs:
check-reviews:
# Only run if passing the basic GitHub review requirements.
if: github.event.review.state == 'APPROVED'
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Check reviews
env:
PR_REF: github.ref
shell: python
run: |
import os
import sys
ref = os.getenv("PR_REF")
print(f"Ref: {ref}")
# Get info with gh pr -R MetOffice/CSET view $PR_NUMBER --json
# labels,reviews If full_review label exists parse with program to see
# if enough reviews. Newer reviews by the same person should
# invalidate older reviews.
sys.exit(0)