summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/git-commit-message-style.yml
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2024-03-13 14:14:11 +0100
committerLinus Färnstrand <linus@mullvad.net>2024-03-14 10:10:19 +0100
commited07f1471a733b81dc228a205c4554f8be130749 (patch)
tree90a21e7d2c5f1f30703d038eac6a9318f334300e /.github/workflows/git-commit-message-style.yml
parent93b9d8dfd0ed35b673d3d2a785114932c291e893 (diff)
downloadmullvadvpn-ed07f1471a733b81dc228a205c4554f8be130749.tar.xz
mullvadvpn-ed07f1471a733b81dc228a205c4554f8be130749.zip
Check for unicode whitespace characters
Diffstat (limited to '.github/workflows/git-commit-message-style.yml')
-rw-r--r--.github/workflows/git-commit-message-style.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/.github/workflows/git-commit-message-style.yml b/.github/workflows/git-commit-message-style.yml
index ddb55b4160..76a53a0e77 100644
--- a/.github/workflows/git-commit-message-style.yml
+++ b/.github/workflows/git-commit-message-style.yml
@@ -16,3 +16,15 @@ jobs:
allow-one-liners: 'true'
# This action defaults to 50 char subjects, but 74 is fine.
max-subject-line-length: '74'
+
+ - name: Check for unicode whitespaces
+ uses: gsactions/commit-message-checker@v2
+ 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