From bc3e22adab617c38f355ae337821b39ec83e32ca Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 11 May 2026 14:11:31 +0000 Subject: [PATCH] chore(ci): strip section heading from extracted release notes The previous regex captured the entire matched section INCLUDING the `#### X.Y.Z ####` heading line. The GitHub release page then displayed both: - the release title `ShellSyntaxTree 0.1.0-alpha`, AND - the heading inside the body `0.1.0-alpha May 10th 2026` That was visually redundant and the body's hand-typed date often goes stale (publish day usually differs from the day the notes were written by 1+ days). Updated the PowerShell regex to capture only the section BODY (skip the `####`-headed line). GitHub renders the publication date alongside the release title automatically, so we don't lose information. Existing `0.1.0-alpha` release body has been hand-fixed via `gh release edit`. --- .github/workflows/publish_nuget.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_nuget.yml b/.github/workflows/publish_nuget.yml index 9534819..c53a0e6 100644 --- a/.github/workflows/publish_nuget.yml +++ b/.github/workflows/publish_nuget.yml @@ -80,12 +80,18 @@ jobs: - name: "Extract latest release notes" shell: pwsh run: | + # RELEASE_NOTES.md uses `#### X.Y.Z[-suffix] ####` per-section + # headings. Capture only the BODY of the first section (no heading) + # so the GitHub release page doesn't duplicate the version string in + # both the title and the first line of the body, and so a stale + # hand-typed date in the heading doesn't fight the published date + # GitHub renders automatically. if (-not (Test-Path RELEASE_NOTES.md)) { "No release notes available." | Set-Content RELEASE_NOTES_LATEST.md exit 0 } $content = Get-Content RELEASE_NOTES.md -Raw - if ($content -match '(?s)(####.+?)(?=\n####|\z)') { + if ($content -match '(?s)####[^\r\n]*\r?\n+(.+?)(?=\r?\n####|\z)') { $Matches[1].Trim() | Set-Content RELEASE_NOTES_LATEST.md } else { $content | Set-Content RELEASE_NOTES_LATEST.md