mirror of
https://github.com/maigamo/Daily-Task-Auto-Generator.git
synced 2026-07-22 05:48:30 +00:00
Merge branch 'main' of https://github.com/maigamo/Daily-Task-Auto-Generator
This commit is contained in:
commit
c90daef85a
1 changed files with 7 additions and 2 deletions
9
.github/workflows/main.yml
vendored
9
.github/workflows/main.yml
vendored
|
|
@ -62,13 +62,18 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# 仅在 push 事件时校验提交信息格式
|
||||
# 仅在 push 事件时校验提交信息格式,跳过合并提交
|
||||
- name: Enforce commit message format (push only)
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
COMMIT_MSG=$(git log -1 --pretty=%B)
|
||||
echo "Last commit: $COMMIT_MSG"
|
||||
if ! echo "$COMMIT_MSG" | grep -E -q '^(feat|fix|chore|docs|style|refactor|test)(\(.+\))?: .+'; then
|
||||
if echo "$COMMIT_MSG" | grep -q 'Merge branch'; then
|
||||
echo "Merge commit detected, skipping commit message format check."
|
||||
exit 0
|
||||
fi
|
||||
if ! echo "$COMMIT_MSG" | grep -E -q '^(feat|fix|chore|docs|style|refactor|test)(\(.+\))?:\s*.+'
|
||||
then
|
||||
echo "❌ Commit message does not follow conventional format (e.g., 'feat: xxx')"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue