Skip to content

feat(security): add robust Anti-VPN checker with optional Redis support #29

feat(security): add robust Anti-VPN checker with optional Redis support

feat(security): add robust Anti-VPN checker with optional Redis support #29

name: Validate Commit Messages

Check failure on line 1 in .github/workflows/commit-message-check.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/commit-message-check.yml

Invalid workflow file

(Line: 17, Col: 14): Unexpected symbol: '|'. Located at position 22 within expression: github.event.commits | length
on:
push:
branches:
- main
jobs:
check-commit-messages:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check commit messages
run: |
echo "Checking commit messages on main branch..."
commits=$(git log -n ${{ github.event.commits | length }} --pretty=format:%s)
pattern='^(feat|fix|chore|docs|style|refactor|perf|test|build)(\(.+\))?: .+'
invalid=0
while IFS= read -r line; do
if ! [[ "$line" =~ $pattern ]]; then
echo "❌ Invalid commit message: $line"
invalid=1
fi
done <<< "$commits"
if [ $invalid -eq 1 ]; then
echo "::error::Some commit messages do not follow the conventional commit format."
exit 1
else
echo "✅ All commit messages are valid."
fi