mirror of
https://github.com/prompt-security/clawsec.git
synced 2026-06-13 05:28:02 +03:00
fix: improve changelog extraction logic to handle additional separators and headings
This commit is contained in:
@@ -801,13 +801,14 @@ jobs:
|
||||
fi
|
||||
|
||||
# Extract the changelog section for this version
|
||||
# Pattern: ## [VERSION] - DATE ... until next ## [ or end of file
|
||||
# Pattern: ## [VERSION] - DATE ... until next ## [, separator (---), or any other ## heading
|
||||
CHANGELOG_ENTRY=$(awk -v version="$VERSION" '
|
||||
BEGIN { in_section = 0; found = 0 }
|
||||
$0 ~ ("^## \\[" version "\\]") { in_section = 1; found = 1; next }
|
||||
in_section && /^## \[/ && found { exit }
|
||||
in_section && found && /^---/ { exit }
|
||||
in_section && found && /^## / { exit }
|
||||
in_section { print }
|
||||
' "$SKILL_PATH/CHANGELOG.md")
|
||||
' "$SKILL_PATH/CHANGELOG.md" | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}')
|
||||
|
||||
if [ -z "$CHANGELOG_ENTRY" ]; then
|
||||
echo "No changelog entry found for version $VERSION"
|
||||
|
||||
Reference in New Issue
Block a user