Skip to content

fix(ci): match BREAKING CHANGE only as a footer in skip probe#196

Merged
GSTJ merged 1 commit into
mainfrom
fix/release-skip-prose-falsematch
May 19, 2026
Merged

fix(ci): match BREAKING CHANGE only as a footer in skip probe#196
GSTJ merged 1 commit into
mainfrom
fix/release-skip-prose-falsematch

Conversation

@GSTJ
Copy link
Copy Markdown
Owner

@GSTJ GSTJ commented May 19, 2026

The skip probe in release.yml (added in #195) used git log --grep which scans the entire commit message body. The squashed PR description for #195 mentioned BREAKING CHANGE in its explanation prose, which falsely matched the regex → skip=false → release-it bumped to 7.0.2 and tried to publish.

Net effect: 7.0.2 got published (npm has it), then the workflow died on git push permission. Workflow status: red on main.

Fix

Replace git log --grep with explicit per-commit (subject, body) iteration using ASCII unit/record separators. Match (modal) only in the subject line, and require BREAKING CHANGE: (or BREAKING-CHANGE:) to start a body line — i.e. the actual conventional-commits footer form, not a mention in prose.

Verified locally on origin/main: the merge commit of #195 is now correctly classified as non-qualifying.

Expected behavior next push to main

The previous skip probe used `git log --grep` which scans the entire
commit message including the squashed PR body. The PR description for
the prior skip-fix itself mentioned 'BREAKING CHANGE' in prose, which
falsely matched, set skip=false, and triggered an accidental publish.

Switch to an explicit iteration: split commits into (subject, body),
match '(modal)' only in the subject, and require 'BREAKING CHANGE:'
to start a body line (the conventional-commits footer form).
Copilot AI review requested due to automatic review settings May 19, 2026 21:17
@GSTJ GSTJ enabled auto-merge (squash) May 19, 2026 21:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the “skip probe” logic in the 🚀 Publish GitHub Actions workflow to avoid false positives when commit messages mention BREAKING CHANGE in prose, ensuring releases only trigger on actual Conventional Commits signals.

Changes:

  • Replaces git log --grep (whole-message matching) with explicit per-commit parsing of subject vs body.
  • Counts a commit as qualifying only if (modal) is present in the subject or a BREAKING CHANGE: / BREAKING-CHANGE: footer line exists in the body.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +123 to +125
sha=$(printf '%s' "$entry" | awk -F"$UNIT" '{print $1}')
subject=$(printf '%s' "$entry" | awk -F"$UNIT" '{print $2}')
body=$(printf '%s' "$entry" | awk -F"$UNIT" '{for(i=3;i<=NF;i++) printf "%s%s", $i, (i<NF?FS:"")}')
Comment on lines +117 to +120
UNIT=$'\x1f'
REC=$'\x1e'
COMMITS=$(git log "$BOUNDARY..HEAD" --pretty=format:"%H${UNIT}%s${UNIT}%b${REC}")
QUALIFY=""
@GSTJ GSTJ merged commit d89193f into main May 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants