fix(ci): match release + forge-announce parsing to current yaml format
Both workflows looked for "**Hellion Chat <version>" as the changelog subblock header, but the yaml convention is "**v<version> — <subtitle>" (matches verify-changelog-sync.sh and the slim-rule grep). Plus the indent-strip was 2 spaces, but prettier writes the changelog block with 4-space indent. Both regressions silently failed every release-workflow run since the format change — likely why v1.4.3 was released manually. Sync header marker to "**v$version " and indent-strip to 4 spaces in both files.
This commit is contained in:
@@ -101,16 +101,16 @@ jobs:
|
|||||||
if ($idx -lt 0) { throw "V5: changelog-Block nicht gefunden in $yamlPath" }
|
if ($idx -lt 0) { throw "V5: changelog-Block nicht gefunden in $yamlPath" }
|
||||||
$afterMarker = $raw.Substring($idx + $marker.Length)
|
$afterMarker = $raw.Substring($idx + $marker.Length)
|
||||||
$changelogBody = (($afterMarker -split "`r?`n") | ForEach-Object {
|
$changelogBody = (($afterMarker -split "`r?`n") | ForEach-Object {
|
||||||
if ($_ -match '^ ') { $_.Substring(2) } else { $_ }
|
if ($_ -match '^ ') { $_.Substring(4) } else { $_ }
|
||||||
}) -join "`n"
|
}) -join "`n"
|
||||||
|
|
||||||
$header = "**Hellion Chat $version"
|
$header = "**v$version "
|
||||||
$start = $changelogBody.IndexOf($header)
|
$start = $changelogBody.IndexOf($header)
|
||||||
if ($start -lt 0) {
|
if ($start -lt 0) {
|
||||||
throw "V5: No changelog entry for version $version found in $yamlPath. Update the changelog block before tagging."
|
throw "V5: No changelog entry for version $version found in $yamlPath. Update the changelog block before tagging."
|
||||||
}
|
}
|
||||||
$rest = $changelogBody.Substring($start)
|
$rest = $changelogBody.Substring($start)
|
||||||
$nextHdr = $rest.IndexOf("`n`n**Hellion Chat ", 1)
|
$nextHdr = $rest.IndexOf("`n`n**v", 1)
|
||||||
$trailer = $rest.IndexOf("`n`n---")
|
$trailer = $rest.IndexOf("`n`n---")
|
||||||
if ($nextHdr -ge 0 -and ($trailer -lt 0 -or $nextHdr -lt $trailer)) {
|
if ($nextHdr -ge 0 -and ($trailer -lt 0 -or $nextHdr -lt $trailer)) {
|
||||||
$enBlock = $rest.Substring(0, $nextHdr).TrimEnd()
|
$enBlock = $rest.Substring(0, $nextHdr).TrimEnd()
|
||||||
|
|||||||
@@ -111,20 +111,22 @@ jobs:
|
|||||||
|
|
||||||
# changelog: is the last top-level key in the manifest, so
|
# changelog: is the last top-level key in the manifest, so
|
||||||
# everything after the marker is the literal block. Strip the
|
# everything after the marker is the literal block. Strip the
|
||||||
# 2-space yaml indent from each line.
|
# 4-space yaml indent (prettier convention) from each line.
|
||||||
$afterMarker = $raw.Substring($idx + $marker.Length)
|
$afterMarker = $raw.Substring($idx + $marker.Length)
|
||||||
$changelogBody = (($afterMarker -split "`r?`n") | ForEach-Object {
|
$changelogBody = (($afterMarker -split "`r?`n") | ForEach-Object {
|
||||||
if ($_ -match '^ ') { $_.Substring(2) } else { $_ }
|
if ($_ -match '^ ') { $_.Substring(4) } else { $_ }
|
||||||
}) -join "`n"
|
}) -join "`n"
|
||||||
|
|
||||||
$header = "**Hellion Chat $version"
|
# Subblock convention: "**vX.Y.Z — <subtitle> (<date>)**"
|
||||||
|
# matches verify-changelog-sync.sh and slim-rule grep.
|
||||||
|
$header = "**v$version "
|
||||||
$start = $changelogBody.IndexOf($header)
|
$start = $changelogBody.IndexOf($header)
|
||||||
if ($start -lt 0) {
|
if ($start -lt 0) {
|
||||||
throw "No changelog entry for version $version found in $yamlPath. Update the changelog block before tagging a release."
|
throw "No changelog entry for version $version found in $yamlPath. Update the changelog block before tagging a release."
|
||||||
}
|
}
|
||||||
|
|
||||||
$rest = $changelogBody.Substring($start)
|
$rest = $changelogBody.Substring($start)
|
||||||
$nextHdr = $rest.IndexOf("`n`n**Hellion Chat ", 1)
|
$nextHdr = $rest.IndexOf("`n`n**v", 1)
|
||||||
$trailer = $rest.IndexOf("`n`n---")
|
$trailer = $rest.IndexOf("`n`n---")
|
||||||
|
|
||||||
if ($nextHdr -ge 0 -and ($trailer -lt 0 -or $nextHdr -lt $trailer)) {
|
if ($nextHdr -ge 0 -and ($trailer -lt 0 -or $nextHdr -lt $trailer)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user