Skip to content

PR review status

PR review status #602

Workflow file for this run

name: PR review status
permissions: read-all
on:
pull_request_review:
types: [submitted]
jobs:
# We require a single commit, but only after the review process is complete
# and the PR has an Approval. This fails if there are multiple commits and the
# PR is approved. Otherwise, the PR is ready for internal migration, the
# maintainer may apply the the `pull ready` label.
require-single-commit-on-approval:
if: ${{ github.event.review.state == 'approved' }}
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # pin@v3
- name: Assert single commit
env:
commits: ${{ github.event.pull_request.commits }}
run: |
if (( commits > 1 )); then
echo "::error::Expected approved PR to have a single commit, but found $commits. google/heir requires a single commit per PR because Google's internal/external synchronization tooling does not support squashing, and instead would rebase all commits into the main branch."
exit 1
fi