-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (37 loc) · 1.46 KB
/
commit_message.yml
File metadata and controls
39 lines (37 loc) · 1.46 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
name: 'Commit Message'
on: [push]
jobs:
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- name: Check Title Capitalize
uses: gsactions/commit-message-checker@v1
with:
pattern: '^[^a-z]'
flags: ''
error: 'Your title should capitalize first word, read CONTRIBUTING.md for more details.'
- 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, read CONTRIBUTING.md for more details.'
- name: Check Title Line Length
uses: gsactions/commit-message-checker@v1
with:
pattern: '^([^\n]{1,50}|Merge pull request.*|Merge .*branch .*)(\n.*)?$'
flags: 's'
error: 'The maximum title line length of 50 characters is exceeded, read CONTRIBUTING.md for more details.'
- 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,72})*$'
flags: 's'
error: 'The maximum line length of 72 characters is exceeded, read CONTRIBUTING.md for more details.'