Skip to content

Commit b2679ec

Browse files
jwiegleykarthink
authored andcommitted
meta: Add GitHub CI for commit message linting
1 parent 8bd92f5 commit b2679ec

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/commits.yml

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

0 commit comments

Comments
 (0)