-
Notifications
You must be signed in to change notification settings - Fork 207
45 lines (44 loc) · 1.72 KB
/
commit_message_checker.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
---
# https://github.com/marketplace/actions/gs-commit-message-checker
name: 'Commit Message Check'
# yamllint disable-line rule:truthy
on:
pull_request:
push:
branches:
- '!master' # we must not fix commit messages when they already reached master
jobs:
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- name: Check Subject Begining
uses: gsactions/commit-message-checker@v1
with:
pattern: '^([A-Z]|[A-Za-z0-9_/.\-\s]+:|git subrepo pull)'
flags: 'g'
error: 'The subject does not start with a capital or tag.'
excludeDescription: 'true'
excludeTitle: 'true'
checkAllCommitMessages: 'true'
accessToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check Subject Line Length
uses: gsactions/commit-message-checker@v1
with:
pattern: '^.{1,72}(\n|$)'
flags: 'g'
error: 'The maximum subject line length of 72 characters is exceeded.'
excludeDescription: 'true' # excludes the description body of a pull request
excludeTitle: 'true' # excludes the title of a pull request
checkAllCommitMessages: 'true' # checks all commits associated with a pull request
accessToken: ${{ secrets.GITHUB_TOKEN }} # only required if checkAllCommitMessages is true
- name: Check Empty Line
uses: gsactions/commit-message-checker@v1
with:
pattern: '^.*(\n\n|$)'
flags: 'g'
error: 'No newline between title and description.'
excludeDescription: 'true'
excludeTitle: 'true'
checkAllCommitMessages: 'true'
accessToken: ${{ secrets.GITHUB_TOKEN }}