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.
This commit is contained in:
Darren Hinde 2025-12-09 13:31:02 +00:00 committed by GitHub
parent 784ffadf92
commit 62f77343a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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