From 2a9238877298cf8dd3dabc983e5e6ef4c2764a7f Mon Sep 17 00:00:00 2001 From: Darren Hinde <107584450+darrenhinde@users.noreply.github.com> Date: Tue, 9 Dec 2025 13:57:50 +0000 Subject: [PATCH] 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 --- .github/workflows/post-merge-pr.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/post-merge-pr.yml b/.github/workflows/post-merge-pr.yml index 89c7f36..900773e 100644 --- a/.github/workflows/post-merge-pr.yml +++ b/.github/workflows/post-merge-pr.yml @@ -68,15 +68,20 @@ jobs: exit 0 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 - 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 "Automated commit detected - skipping to prevent loops" + echo "Automated commit detected in title - skipping to prevent loops" exit 0 fi + # Get full commit message for version bump type detection + COMMIT_MSG=$(git log -1 --pretty=%B) + # Determine version bump type from commit message if echo "$COMMIT_MSG" | grep -qiE "^(feat|feature)\(.*\)!:|^BREAKING CHANGE:|^[a-z]+!:"; then echo "bump_type=major" >> $GITHUB_OUTPUT