-
-
Notifications
You must be signed in to change notification settings - Fork 20
54 lines (52 loc) · 1.7 KB
/
commit-message.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: GIT commit message check
on:
push:
branches-ignore:
- 'l10n_master'
tags-ignore:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
types:
- opened
- edited
- reopened
- synchronize
jobs:
check-commit-message:
name: Check commit message
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check type prefix
uses: gsactions/commit-message-checker@v2
with:
pattern: '^(?:\[!!!\])?\[(BUILD|TASK|BUGFIX|FIX|FEATURE|DOC|CLEANUP|RELEASE){1}\] .+$'
flags: 'gm'
error: 'The first line needs to start with a commit type like "[BUGFIX]".'
excludeTitle: "true"
excludeDescription: "true"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check message format
uses: gsactions/commit-message-checker@v2
with:
pattern: '^(?:\[!!!\])?\[[A-Z]+\] [A-Z]+.+$'
flags: 'gm'
error: 'The actual message after the commit type should start with a uppercase letter.'
excludeTitle: "true"
excludeDescription: "true"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check line length
uses: gsactions/commit-message-checker@v2
with:
pattern: "^.{0,72}(\n.*)*$"
flags: 'gm'
error: 'The maximum line length of 72 characters is exceeded.'
excludeTitle: "true"
excludeDescription: "true"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.GITHUB_TOKEN }}