Skip to content

feat: update action conventional commits #31

feat: update action conventional commits

feat: update action conventional commits #31

# custom commit checker
name: Check Commit Message CUSTOM
on:
push:
branches:
- main
jobs:
check_commit_message:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check commit message
run: |
COMMIT_MSG=$(git log --format=%B -n 1 ${{ github.sha }})
PATTERN_MSG='^(fixup! )?(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .{1,100}$'
if [[ ! $COMMIT_MSG =~ $PATTERN_MSG ]]; then
echo "Invalid commit message format. Must match pattern: /^(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .{1,100}$/"
exit 1
fi
- name: Check commit description
run: |
COMMIT_DESC=$(git log --format=%b -n 1 ${{ github.sha }})
PATTERN_DESC='^.{1,200}$'
if [[ ! $COMMIT_DESC =~ $PATTERN_DESC ]]; then
echo "Invalid commit description format. Must be up to 200 characters long."
exit 1
fi