Skip to content

Commit

Permalink
zess: add commit message check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-dev committed Jun 11, 2024
1 parent fbb27f9 commit 56ec3e8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/commit_message_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: commit message check
run-name: commit message check
on: [push]

jobs:
check_commit_messages:
runs-on: ubuntu-latest

steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: check commit messages
run: |
git log --format="%s" origin/main..HEAD | while IFS= read -r message; do
if ! [[ $message =~ ^(vingo:|vinscant:|vinvoor:|zess:) ]]; then
echo $message
echo "Error: commit message should start with vingo:|vinscant:|vinvoor:|zess: depending on which subproject you are working on."
exit 1
fi
if ! [[ $message =~ ^.*:\ [a-z].* ]]; then
echo $message
echo "Error: first letter after project specifier should be lower case"
exit 1
fi
done

0 comments on commit 56ec3e8

Please sign in to comment.