generated from golang-templates/seed
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.4 KB
/
commit.yml
File metadata and controls
44 lines (40 loc) · 1.4 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
name: 'Commit Message Check'
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
check-commit-message:
runs-on: ubuntu-latest
steps:
- name: Commit Area Valid
uses: gsactions/commit-message-checker@v2
with:
pattern: '^((\w+ [\w\*]+)|(\w+)): .+'
flags: ''
excludeTitle: 'true'
excludeDescription: 'true'
checkAllCommitMessages: 'true'
accessToken: ${{ secrets.GITHUB_TOKEN }}
error: 'Commit titles should be prefixed by the primary area impacted. An example might be `go webutil: add http3 support`.'
- name: Check Line Length
uses: gsactions/commit-message-checker@v2
with:
pattern: '^.{0,72}$'
excludeTitle: 'true'
excludeDescription: 'true'
checkAllCommitMessages: 'true'
accessToken: ${{ secrets.GITHUB_TOKEN }}
error: 'No line in the commit message should exceed 72 characters.'
- name: Commit Has Message
uses: gsactions/commit-message-checker@v2
with:
pattern: '^.*\n\n.+$'
flags: 's'
excludeTitle: 'true'
excludeDescription: 'true'
checkAllCommitMessages: 'true'
accessToken: ${{ secrets.GITHUB_TOKEN }}
error: 'Every commit should have a title followed by a blank line, and then a detailed message.'