From 66aa52b8c5bc61bd562a7a014a770af96b83c083 Mon Sep 17 00:00:00 2001 From: harald Date: Mon, 21 Sep 2026 11:38:38 +0200 Subject: [PATCH] chore(scripts): extract version-specific changelog section for release body --- scripts/publish-release.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/publish-release.ps1 b/scripts/publish-release.ps1 index e06e122..7385457 100644 --- a/scripts/publish-release.ps1 +++ b/scripts/publish-release.ps1 @@ -81,12 +81,18 @@ $Release = $ExistingReleases | Where-Object { $_.tag_name -eq $TagName } if (-not $Release) { $Utf8NoBom = New-Object System.Text.UTF8Encoding($false) - $Changelog = [System.IO.File]::ReadAllText((Join-Path $ProjectRoot "CHANGELOG.md"), $Utf8NoBom) + $FullChangelog = [System.IO.File]::ReadAllText((Join-Path $ProjectRoot "CHANGELOG.md"), $Utf8NoBom) + $VersionPattern = "(?s)## \[$([regex]::Escape($Version))\].*?(?=(?:\r?\n## \[|\z))" + if ($FullChangelog -match $VersionPattern) { + $ReleaseBody = $matches[0].Trim() + } else { + $ReleaseBody = $FullChangelog + } $PayloadPath = Join-Path $DistDir "release_req.json" $Payload = @{ tag_name = $TagName name = "Sanctum $TagName (Windows & Linux x86_64)" - body = $Changelog + body = $ReleaseBody draft = $false prerelease = $false } | ConvertTo-Json -Depth 5