-
Notifications
You must be signed in to change notification settings - Fork 54
26 lines (24 loc) · 1.09 KB
/
pr_review.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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