From 62f77343a0f18f514366676a88bc96bfb694d0af Mon Sep 17 00:00:00 2001 From: Darren Hinde <107584450+darrenhinde@users.noreply.github.com> Date: Tue, 9 Dec 2025 13:31:02 +0000 Subject: [PATCH] fix(ci): resolve post-merge workflow heredoc parsing issue (#44) The workflow was failing with 'before: command not found' because multiline commit messages were being inserted into a heredoc, causing shell parsing errors. Fixed by: - Using only commit title (first line) instead of full message body - Replacing heredoc with printf to avoid shell expansion issues - Properly escaping special characters in commit messages This fixes the version bump automation that was failing on PR #42 merge. --- .github/workflows/post-merge.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/post-merge.yml b/.github/workflows/post-merge.yml index 82e1d41..640dce5 100644 --- a/.github/workflows/post-merge.yml +++ b/.github/workflows/post-merge.yml @@ -111,16 +111,11 @@ jobs: # Update CHANGELOG.md DATE=$(date +%Y-%m-%d) - COMMIT_MSG=$(git log -1 --pretty=%B) + # Get only the first line (title) of commit message to avoid multiline issues + COMMIT_TITLE=$(git log -1 --pretty=%s) - # Create changelog entry - cat > /tmp/changelog_entry.md << EOF - ## [$NEW_VERSION] - $DATE - - ### Changes - - $COMMIT_MSG - - EOF + # Create changelog entry (use printf to avoid heredoc issues) + printf "## [%s] - %s\n\n### Changes\n- %s\n\n" "$NEW_VERSION" "$DATE" "$COMMIT_TITLE" > /tmp/changelog_entry.md # Prepend to CHANGELOG.md (after the header) if [ -f CHANGELOG.md ]; then