-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 1.44 KB
/
git-commit-message-style.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
---
name: Git - Check commit message style
on:
push:
workflow_dispatch:
jobs:
check-commit-message-style:
name: Check commit message style
runs-on: ubuntu-latest
steps:
# Make sure there are no whitespaces other than space, tab and newline in a commit message.
- name: Check for unicode whitespaces
uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee #v2.0.0
with:
# Pattern matches strings not containing weird unicode whitespace/separator characters
# \P{Z} = All non-whitespace characters (the u-flag is needed to enable \P{Z})
# [ \t\n] = Allowed whitespace characters
pattern: '^(\P{Z}|[ \t\n])+$'
flags: 'u'
error: 'Detected unicode whitespace character in commit message.'
checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request
accessToken: ${{ secrets.GITHUB_TOKEN }} # only required if checkAllCommitMessages is true
# Git commit messages should follow these guidelines: https://cbea.ms/git-commit/
- name: Check against guidelines
uses: mristin/opinionated-commit-message@f3b9cec249cabffbae7cd564542fd302cc576827 #v3.1.1
with:
# Commit messages are allowed to be subject only, no body
allow-one-liners: 'true'
# This action defaults to 50 char subjects, but 72 is fine.
max-subject-line-length: '72'