Skip to content

Commit 5b34333

Browse files
bokelleyclaude
andcommitted
ci: skip merge commits from remote-tracking refs
`git merge origin/main` produces "Merge remote-tracking branch 'origin/main' …", which the conventional-commits skip regex didn't match — only `Merge branch '<name>'` was covered. Validator then flagged the merge commit as a malformed conventional commit and failed the check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3df0a54 commit 5b34333

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,14 @@ jobs:
114114
# Check each commit since the base
115115
echo "Validating commits since $BASE_SHA..."
116116
git log --format="%H %s" $BASE_SHA..HEAD | while read sha message; do
117-
# Skip merge commits. Two GitHub-created shapes:
117+
# Skip merge commits. Three GitHub/git-created shapes:
118118
# - "Merge <sha> into <sha>" — the merge-queue API path
119119
# (clicking "Update branch" on a PR)
120120
# - "Merge branch '<name>' [into <name>]" — `gh pr update-branch`
121-
# and `git merge` defaults
122-
if echo "$message" | grep -qE "^Merge ([0-9a-f]+ into [0-9a-f]+|branch '[^']+')"; then
121+
# and `git merge <local-branch>` defaults
122+
# - "Merge remote-tracking branch '<name>' [into <name>]" —
123+
# `git merge origin/<branch>` default
124+
if echo "$message" | grep -qE "^Merge ([0-9a-f]+ into [0-9a-f]+|(remote-tracking )?branch '[^']+')"; then
123125
echo "⊙ Skipping merge commit: $sha"
124126
continue
125127
fi

0 commit comments

Comments
 (0)