Add action to check commit messages for line length.

This commit is contained in:
John MacFarlane 2020-05-21 10:02:28 -07:00
parent 1e031ae63a
commit 7902ac5256

View file

@ -0,0 +1,34 @@
name: 'Commit Message Check'
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
push:
branches:
- master
- 'releases/*'
jobs:
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
# - name: Check Commit Type
# uses: gsactions/commit-message-checker@v1
# with:
# pattern: '\[[^]]+\] .+$'
# flags: 'gm'
# error: 'Your first line has to contain a commit type like "[BUGFIX]".'
- name: Check Line Length
uses: gsactions/commit-message-checker@v1
with:
pattern: '^[^#].{78}'
error: 'The maximum line length of 78 characters is exceeded.'
# - name: Check for Resolves / Fixes
# uses: gsactions/commit-message-checker@v1
# with:
# pattern: '^.+(Resolves|Fixes): \#[0-9]+$'
# error: 'You need at least one "Resolves|Fixes: #<issue number>" line.'