forked from Ericsson/codechecker
-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (25 loc) · 870 Bytes
/
Copy pathcheck_fixups.yml
File metadata and controls
30 lines (25 loc) · 870 Bytes
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
27
28
29
30
name: Git Fixup Commit Check
on:
pull_request:
branches: [ master ]
types: [ opened, synchronize, reopened ]
jobs:
check_fixups:
name: Check for fixup commits
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify commit messages
run: |
echo "Checking commit messages for fixup commits... "
FIXUPS=$(git log ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} --oneline | grep -E "^[a-f0-9]+ fixup!" || true)
if [ -n "$FIXUPS" ]; then
echo "ERROR: Found 'fixup!' commits in this pull request. Please squash them before merging!"
echo "Found items:"
echo "$FIXUPS"
exit 1
fi
echo "No fixup! commits found!"