fix(ci): match BREAKING CHANGE only as a footer in skip probe#196
Merged
Conversation
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).
There was a problem hiding this comment.
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 aBREAKING 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="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The skip probe in
release.yml(added in #195) usedgit log --grepwhich scans the entire commit message body. The squashed PR description for #195 mentionedBREAKING CHANGEin 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 --grepwith explicit per-commit (subject, body) iteration using ASCII unit/record separators. Match(modal)only in the subject line, and requireBREAKING CHANGE:(orBREAKING-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
fix(ci):(no(modal)scope, noBREAKING CHANGE:footer)