Skip to content

Commit f99f1fb

Browse files
committed
Add commit message linting
1 parent 8dbe55d commit f99f1fb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/commits.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Lint Commit Messages
2+
on: [pull_request]
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- name: Check commit messages
9+
run: |
10+
for sha in $(git rev-list origin/main..HEAD); do
11+
msg=$(git log --format=%B -n 1 $sha)
12+
echo "$msg" | grep -E "^(feat|fix|docs|chore): .{10,}$" || exit 1
13+
done

0 commit comments

Comments
 (0)