fix(ci): check only commit title for skip patterns (#46)
* fix(ci): check only commit title for skip patterns The workflow was incorrectly checking the entire commit body for [skip ci] patterns, causing false positives when the body mentioned these patterns in documentation. Fixed by: - Check only commit title (first line) for skip patterns - Use git log --pretty=%s instead of %B for skip detection - Still use full body for version bump type detection This prevents false positives while maintaining loop prevention. * chore: trigger CI checks
This commit is contained in:
parent
7cd5af13dc
commit
2a92388772
1 changed files with 8 additions and 3 deletions
11
.github/workflows/post-merge-pr.yml
vendored
11
.github/workflows/post-merge-pr.yml
vendored
|
|
@ -68,15 +68,20 @@ jobs:
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
COMMIT_MSG=$(git log -1 --pretty=%B)
|
# Check commit title (first line only) for skip patterns
|
||||||
|
COMMIT_TITLE=$(git log -1 --pretty=%s)
|
||||||
|
|
||||||
# Skip if this is an automated commit to prevent loops
|
# Skip if this is an automated commit to prevent loops
|
||||||
if echo "$COMMIT_MSG" | grep -qE "\[skip ci\]|chore: bump version|docs: sync|chore: version and docs sync"; then
|
# Only check the title, not the full body to avoid false positives
|
||||||
|
if echo "$COMMIT_TITLE" | grep -qE "\[skip ci\]|chore: bump version|docs: sync|chore: version and docs sync"; then
|
||||||
echo "should_sync=false" >> $GITHUB_OUTPUT
|
echo "should_sync=false" >> $GITHUB_OUTPUT
|
||||||
echo "Automated commit detected - skipping to prevent loops"
|
echo "Automated commit detected in title - skipping to prevent loops"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Get full commit message for version bump type detection
|
||||||
|
COMMIT_MSG=$(git log -1 --pretty=%B)
|
||||||
|
|
||||||
# Determine version bump type from commit message
|
# Determine version bump type from commit message
|
||||||
if echo "$COMMIT_MSG" | grep -qiE "^(feat|feature)\(.*\)!:|^BREAKING CHANGE:|^[a-z]+!:"; then
|
if echo "$COMMIT_MSG" | grep -qiE "^(feat|feature)\(.*\)!:|^BREAKING CHANGE:|^[a-z]+!:"; then
|
||||||
echo "bump_type=major" >> $GITHUB_OUTPUT
|
echo "bump_type=major" >> $GITHUB_OUTPUT
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue