Skip to content

Merge pull request #23 from Sigmanificient/laplace/9-create-a-complet… #70

Merge pull request #23 from Sigmanificient/laplace/9-create-a-complet…

Merge pull request #23 from Sigmanificient/laplace/9-create-a-complet… #70

name: Commit Norm Checker
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
verify-commit-name:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Commit Norm Checker
run: |
commit_msg=$(git log --format=%B -n 1 ${{ github.sha }})
keyword_regex="^([a-z]+\([A-Za-z_.-]+\)|^[a-z]+): "
if [[ ! $commit_msg =~ $keyword_regex ]]; then
if [[ $commit_msg =~ ^Merge\ .* ]]; then
echo "Skipping merge commit"
else
echo $commit_msg
echo "Commit message does not match expected format. Please use the following format: \"keyword(scope): comment\""
exit 1
fi
fi