From 3efa3953499d72daa1c10624ca81edbc3c768c2b Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Sat, 4 Jul 2026 23:24:07 +0000 Subject: [PATCH] fix: prepend the dependabot breaking-change note so majors trigger a major release The BREAKING CHANGE note added for major production dependency bumps was appended to the end of the PR body. Dependabot bodies always contain a Markdown thematic break (---), and the conventional-commits parser stops recognising a BREAKING CHANGE footer note once a --- separates it from the header, so the note was silently ignored and the squashed commit resolved to a patch instead of a major (verified against @semantic-release/commit-analyzer 13.0.1). Prepending the note into the first paragraph makes it resolve to a major release. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/automerge.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 21f3c1810..7ef335c15 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -41,11 +41,20 @@ jobs: steps.metadata.outputs.update-type == 'version-update:semver-major' run: | gh pr view "$PR_URL" --json body --jq .body > body.md - # Guard so re-runs (e.g. on synchronize) do not append the footer twice + # Guard so re-runs (e.g. on synchronize) do not add the note twice if ! grep -q '^BREAKING CHANGE:' body.md; then - printf '\n\nBREAKING CHANGE: %s updated from %s to %s (new major version). This update may contain breaking changes.\n' \ - "$DEPENDENCY_NAMES" "$PREVIOUS_VERSION" "$NEW_VERSION" >> body.md - gh pr edit "$PR_URL" --body-file body.md + # The note MUST be prepended, not appended: the conventional-commits + # parser stops treating a "BREAKING CHANGE:" line as a footer note once + # a Markdown thematic break ("---", which dependabot always includes) + # sits between it and the header, so a trailing note is silently ignored + # and the release stays a patch. Putting it in the first paragraph makes + # the squashed commit resolve to a major release. + { + printf 'BREAKING CHANGE: %s updated from %s to %s (new major version). This update may contain breaking changes.\n\n' \ + "$DEPENDENCY_NAMES" "$PREVIOUS_VERSION" "$NEW_VERSION" + cat body.md + } > body.new.md + gh pr edit "$PR_URL" --body-file body.new.md fi env: PR_URL: ${{ github.event.pull_request.html_url }}