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:
@@ -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")"
|
||||
|
||||
Reference in New Issue
Block a user