We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0c4c72 commit dda4571Copy full SHA for dda4571
1 file changed
.github/workflows/enforce-single-commit.yml
@@ -0,0 +1,21 @@
1
+name: Enforce single-commit PR
2
+
3
+on:
4
+ pull_request:
5
+ types: [opened, synchronize, reopened]
6
+ merge_group:
7
8
+jobs:
9
+ check-commit-count:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Verify PR has exactly one commit
13
+ env:
14
+ COMMITS: ${{ github.event.pull_request.commits }}
15
+ run: |
16
+ echo "PR contains $COMMITS commit(s)."
17
+ if [ "$COMMITS" -ne 1 ]; then
18
+ echo "::error::This PR has $COMMITS commits. Please squash to a single commit."
19
+ exit 1
20
+ fi
21
+ echo "OK: PR has exactly 1 commit."
0 commit comments