Browse Source

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.
Darren Hinde 4 months ago
parent
commit
62f77343a0
1 changed files with 4 additions and 9 deletions
  1. 4 9
      .github/workflows/post-merge.yml

+ 4 - 9
.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)
-          
-          # Create changelog entry
-          cat > /tmp/changelog_entry.md << EOF
-          ## [$NEW_VERSION] - $DATE
-          
-          ### Changes
-          - $COMMIT_MSG
+          # Get only the first line (title) of commit message to avoid multiline issues
+          COMMIT_TITLE=$(git log -1 --pretty=%s)
           
-          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