fix: improve changelog extraction in publish script

- Simplified awk extraction without aggressive sed cleanup
- Now correctly extracts version-specific changelog entries
- Works with minimal or full changelog sections
This commit is contained in:
Micha
2026-01-03 16:32:12 +01:00
parent 8dae638111
commit 28104c1bc3

View File

@@ -33,10 +33,15 @@ extract_changelog() {
fi
awk -v ver="## $version" '
/^## [0-9]/ { if (found) exit; if ($0 ~ ver) found=1; next }
found && /^## / { exit }
/^## / {
if (found) exit
if ($0 ~ ver) {
found=1
next
}
}
found { print }
' "$changelog_file" | sed '1d;$d' | sed -e 's/^[[:space:]]*$//' | sed -e :a -e '/^\s*$/d;N;ba'
' "$changelog_file"
}
CHANGELOG_BODY="$(extract_changelog "$VERSION" "$CHANGELOG_FILE")"