From e694a2b8b5e54404fbbde24453ab659d6b5de5f4 Mon Sep 17 00:00:00 2001 From: Patrick Decat Date: Thu, 20 Mar 2025 12:27:41 +0100 Subject: [PATCH] ci: fix changelog extraction (#1810) --- .github/workflows/marketplace-publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/marketplace-publish.yml b/.github/workflows/marketplace-publish.yml index f81ef30c30..0080b10687 100644 --- a/.github/workflows/marketplace-publish.yml +++ b/.github/workflows/marketplace-publish.yml @@ -65,15 +65,15 @@ jobs: current_package_version=$(node -p "require('./package.json').version") # Extract changelog for current version - changelog_content=$(awk -v ver="## [${current_package_version}]" ' - $0 ~ ver {flag=1; next} - /^## \[/ {if (flag) exit} - flag {print} - ' CHANGELOG.md) + echo "Extracting changelog for version ${current_package_version}" + changelog_content=$(sed -n "/## \\[${current_package_version}\\]/,/## \\[/p" CHANGELOG.md | sed '$d') # If changelog extraction failed, use a default message if [ -z "$changelog_content" ]; then + echo "Warning: No changelog section found for version ${current_package_version}" changelog_content="Release v${current_package_version}" + else + echo "Found changelog section for version ${current_package_version}" fi # Create release with changelog content