Skip to content

Fix run

Fix run #55

name: "Commit Message Check"
on:
push:
branches:
- "**"
jobs:
commit-message-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check Commit Messages
run: |
IFS=$'\n' commits=($(git log --format=%s ${{ github.event.before }}..${{ github.event.after }}))
for commit in "${commits[@]}"
do
if ! [[ "$commit" =~ ^(feat|fix|chore|docs|style|refactor|perf|test)(\(.*\))?:?.{2,} ]]; then
echo "Invalid commit message: $commit"
exit 1
fi
done