Skip to content

Commit a38a657

Browse files
fix(workflows): scan only commit subjects for breaking change detection (#1157)
## Summary Fixes false-positive breaking change detection in the pre-release version computation that caused the pre-release version to jump to 4.x instead of 3.x. ## Problem The breaking change detection in `release-prerelease-pr.yml` scanned both commit subjects and bodies (`--format='%s%n%b'`). Dependabot commits embed upstream changelogs in their bodies as HTML. Commit `2290dc0` (`chore(deps): bump the github-actions group...`) included the `actions/create-github-app-token` v3.0.0 changelog, which contains: ``` fix!: require NODE_USE_ENV_PROXY for proxy support ``` The `fix!:` from the **upstream** repo matched the breaking change regex at a line boundary in the body, triggering `HAS_BREAKING > 0` and bumping the pre-release major version to 4. ## Fix Changed `git log --format='%s%n%b'` to `git log --format='%s'` so the grep only scans commit **subjects**. Per the Conventional Commits spec, breaking change indicators (`!:` suffix or `BREAKING CHANGE:` footer) belong in the subject line, making body scanning unnecessary. ## Validation - YAML lint: 43/43 workflow files pass 🔧 - Generated by Copilot
1 parent 0eee5b6 commit a38a657

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/release-prerelease-pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ jobs:
5252
LAST_TAG=$(git tag -l 'hve-core-v*' | awk -F'[v.]' '{if ($(NF-1) % 2 == 0) print}' | sort -V | tail -1)
5353
5454
# Check for breaking changes since last release.
55-
# Match conventional commit subject with ! (e.g. feat!:) or
56-
# a BREAKING CHANGE / BREAKING-CHANGE footer token at line start.
55+
# Only scan commit subjects to avoid false positives from
56+
# Dependabot bodies that embed upstream changelogs.
5757
HAS_BREAKING=0
5858
if [ -n "$LAST_TAG" ]; then
59-
HAS_BREAKING=$(git log "$LAST_TAG"..HEAD --format='%s%n%b' | \
59+
HAS_BREAKING=$(git log "$LAST_TAG"..HEAD --format='%s' | \
6060
grep -cE '^[a-z]+(\(.+\))?!:|^BREAKING[ -]CHANGE:' || true)
6161
fi
6262

0 commit comments

Comments
 (0)