Skip to content

Commit 9488a7c

Browse files
committed
workflows: Add commit message check.
Signed-off-by: iabdalkader <[email protected]>
1 parent c9e1ed6 commit 9488a7c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/commit_check.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Check Commit Message'
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
- synchronize
10+
branches:
11+
- 'main'
12+
13+
jobs:
14+
check-commit-messages:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: 'Check commit messages format'
18+
uses: gsactions/commit-message-checker@v2
19+
with:
20+
pattern: '^[^!]+: [A-Za-z]+.+ .+$'
21+
flags: 'gm'
22+
error: 'Commit subject line must match the following pattern: <scope>: <description>'
23+
excludeTitle: 'false'
24+
excludeDescription: 'true'
25+
checkAllCommitMessages: 'true'
26+
accessToken: ${{ secrets.GITHUB_TOKEN }}
27+
- name: 'Check commit messages length'
28+
uses: gsactions/commit-message-checker@v2
29+
with:
30+
pattern: '^[^#].{10,80}$'
31+
error: 'Commit subject line maximum line length of 80 characters is exceeded.'
32+
excludeTitle: 'false'
33+
excludeDescription: 'true'
34+
checkAllCommitMessages: 'true'
35+
accessToken: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)