-
-
Notifications
You must be signed in to change notification settings - Fork 4
35 lines (33 loc) · 1.05 KB
/
check-commits.yml
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
31
32
33
34
35
name: '📜 Check Commit Messages'
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
branches:
- 'main'
jobs:
check-commit-messages:
runs-on: ubuntu-latest
steps:
- name: '📜 Check commit messages format'
uses: gsactions/commit-message-checker@v1
with:
pattern: '^[^!]+: [A-Za-z]+.+ .+\.$'
flags: 'gm'
error: 'Commit subject line must match the following pattern: <scope>: <description>.'
excludeTitle: 'false'
excludeDescription: 'true'
checkAllCommitMessages: 'true'
accessToken: ${{ secrets.GITHUB_TOKEN }}
- name: '📜 Check commit messages length'
uses: gsactions/commit-message-checker@v1
with:
pattern: '^[^#].{10,78}$'
error: 'Commit subject line maximum line length of 78 characters is exceeded.'
excludeTitle: 'false'
excludeDescription: 'true'
checkAllCommitMessages: 'true'
accessToken: ${{ secrets.GITHUB_TOKEN }}