From 18fc2d0a9e7dbc57012ee4e0c6bfaf680d45cd37 Mon Sep 17 00:00:00 2001 From: Kevin Cui Date: Mon, 15 Jun 2026 06:11:02 -0400 Subject: [PATCH] fix(release): drop blank gap before direct-push commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub's generate-notes leaves a blank-line run before the trailing "Full Changelog" line. The awk that splices direct-push commits in ran after those blanks were already printed, so the commits landed below the gap with another blank added after them — producing a multi-line hole between the PR list and the direct-push commits in both the Release page and the Sparkle update window. Buffer blank lines instead of printing them as they arrive: at the splice point, drop the buffered run, emit the commits flush against the last PR bullet, then exactly one blank line before the section. Blank runs elsewhere are flushed verbatim, so only the pre-splice gap is normalized. Signed-off-by: Kevin Cui --- .github/workflows/build-publish.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 3565fed..decad0f 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -227,14 +227,27 @@ jobs: # Splice the commit bullets onto the end of the "What's Changed" # section: right before the next section GitHub may emit ("## New # Contributors") or the trailing "Full Changelog" line. + # + # GitHub's generate-notes leaves a blank-line RUN before that next + # section (two blanks before "Full Changelog"). Splicing naively + # there would strand those blanks ABOVE the commits — last PR bullet, + # gap, commits, gap, Full Changelog. So buffer blank lines instead of + # printing them as they arrive: at the splice point, drop the buffered + # run and emit the commits flush against the last PR bullet, then + # exactly one blank line before the section. Blank runs anywhere else + # are flushed verbatim — only the pre-splice gap is normalized. awk ' NR == FNR { commits[FNR] = $0; n = FNR; next } + /^[[:space:]]*$/ { blanks++; next } !spliced && (/^## New Contributors/ || /^\*\*Full Changelog/) { for (i = 1; i <= n; i++) print commits[i] print "" spliced = 1 + blanks = 0 + print + next } - { print } + { for (; blanks > 0; blanks--) print ""; print } END { if (!spliced) for (i = 1; i <= n; i++) print commits[i] } ' build/direct-commits.md build/release-notes.md > build/release-notes.md.new mv build/release-notes.md.new build/release-notes.md