From ea165e0bccb59d13b3fafbeb70c8692a801e1aa0 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 11 Nov 2025 14:22:46 +0000 Subject: [PATCH] Fix release notes extraction in workflow - Replace sed with awk for more reliable multiline extraction - Use temp file to capture full script output - Extract content between separator lines correctly - Fixes empty release notes in draft releases Previous issue: sed pattern wasn't matching the separator lines, resulting in empty RELEASE_NOTES variable. New approach: Use awk to capture everything between the two separator lines, handling multiline content properly. Related to #671 (automated release workflow) --- .github/workflows/release.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be23c4d..e03f9bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -174,8 +174,15 @@ jobs: echo "Comparing v${{ inputs.version }} with ${PREVIOUS_TAG}..." - # Generate notes and capture output - RELEASE_NOTES=$(./scripts/generate-release-notes.sh ${{ inputs.version }} "${PREVIOUS_TAG}" 2>&1 | sed -n '/^Generated release notes:/,/^━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━$/{ /^Generated release notes:/d; /^━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━$/d; p; }') + # Generate notes - script writes output between separator lines + # We need to capture everything between the separators + TEMP_OUTPUT=$(mktemp) + ./scripts/generate-release-notes.sh ${{ inputs.version }} "${PREVIOUS_TAG}" > "$TEMP_OUTPUT" 2>&1 + + # Extract notes between separator lines (everything between the two ━━━ lines) + RELEASE_NOTES=$(awk '/^Generated release notes:/{flag=1;next}/^━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━$/{if(flag==1){flag=2}else if(flag==2){flag=3}}flag==2' "$TEMP_OUTPUT") + + rm -f "$TEMP_OUTPUT" # Save to output (escape for GitHub Actions multiline) echo "RELEASE_NOTES<> $GITHUB_OUTPUT