-
Notifications
You must be signed in to change notification settings - Fork 41
49 lines (42 loc) · 1.6 KB
/
commit.yml
File metadata and controls
49 lines (42 loc) · 1.6 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: 'Commit Message Check'
on: [push]
jobs:
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-20.04
steps:
- name: Check Commit Type
uses: gsactions/commit-message-checker@v1
with:
pattern: '^[a-z0-9,\s]+: .+(?:\n(?:\n.+)+)?(?:\n\n.+)?$'
error: 'Your message must have the correct format "<scope>: <subject>" with an optional body and footer separated by blank lines.'
- name: Check Title Capitalize
uses: gsactions/commit-message-checker@v1
with:
pattern: '^[^A-Z]'
flags: ''
error: 'Your title should not capitalize first word.'
- name: Check Title Length
uses: gsactions/commit-message-checker@v1
with:
pattern: '^[^\s]+([ \t]+[^\s]+){2,}[ \t]*(\n.*)?$'
flags: 's'
error: 'A meaningful title should contain at least 3 words.'
- name: Check Title Line Length
uses: gsactions/commit-message-checker@v1
with:
pattern: '^([^\n]{1,80}|Merge pull request.*)(\n.*)?$'
flags: 's'
error: 'The maximum title line length of 80 characters is exceeded.'
- name: Check Title Line Separator
uses: gsactions/commit-message-checker@v1
with:
pattern: '^[^\n]+(\n\n.+)?$'
flags: 's'
error: 'Should leave an empty line after title.'
- name: Check Line Length
uses: gsactions/commit-message-checker@v1
with:
pattern: '^[^\n]+(\n[^\n]{0,80})*$'
flags: 's'
error: 'The maximum line length of 80 characters is exceeded.'