diff --git a/.github/workflows/human-review-policy-trigger.yaml b/.github/workflows/human-review-policy-trigger.yaml new file mode 100644 index 00000000..f9f8f7b6 --- /dev/null +++ b/.github/workflows/human-review-policy-trigger.yaml @@ -0,0 +1,20 @@ +name: Human review policy trigger +# No-op: its completion triggers human-review-policy.yaml, which runs from the +# default branch so that a PR cannot change the policy it is judged by. + +on: + pull_request: + types: [opened, reopened, synchronize, ready_for_review, edited, closed] + pull_request_review: + types: [submitted, edited, dismissed] + # Repos with a merge queue: the merge group's commit needs the status too. + merge_group: + types: [checks_requested] + +permissions: {} + +jobs: + trigger: + runs-on: ubuntu-latest + steps: + - run: echo "PR ${{ github.event.pull_request.number }} ${{ github.event_name }}" diff --git a/.github/workflows/human-review-policy.yaml b/.github/workflows/human-review-policy.yaml new file mode 100644 index 00000000..6065d765 --- /dev/null +++ b/.github/workflows/human-review-policy.yaml @@ -0,0 +1,20 @@ +name: Human review policy +# Reports the required `human-review-policy` status: 1 human approval besides +# the author on a human-authored PR, 2 on a bot-authored one; labels PRs merged +# past it (admin break glass) needs-post-merge-review. Triggered by +# human-review-policy-trigger.yaml; runs from the default branch so a PR cannot +# change the policy it is judged by. Details and options: +# https://github.com/rollbar/human-review-policy + +on: + workflow_run: + workflows: [Human review policy trigger] + types: [completed] + +jobs: + policy: + permissions: + contents: read + pull-requests: write + statuses: write + uses: rollbar/human-review-policy/.github/workflows/human-review-policy.yaml@main