Skip to content

commit message check #18

commit message check

commit message check #18

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