Refactor CI to run in fresh build box #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Enforce single-commit PR | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| merge_group: | |
| jobs: | |
| check-commit-count: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify PR has exactly one commit | |
| env: | |
| COMMITS: ${{ github.event.pull_request.commits }} | |
| run: | | |
| echo "PR contains $COMMITS commit(s)." | |
| if [ "$COMMITS" -ne 1 ]; then | |
| echo "::error::This PR has $COMMITS commits. Please squash to a single commit." | |
| exit 1 | |
| fi | |
| echo "OK: PR has exactly 1 commit." |