diff --git a/.github/workflows/hotfix-branch-creation.yml b/.github/workflows/hotfix-branch-creation.yml index 2cb77a7a..9b0cbe76 100644 --- a/.github/workflows/hotfix-branch-creation.yml +++ b/.github/workflows/hotfix-branch-creation.yml @@ -172,10 +172,13 @@ jobs: " - # Insert after the first line (title) - sed -i "1 a\\ -\\ -$HOTFIX_ENTRY" "$CHANGELOG_PATH" + # Insert after the first line (title) using a temp file + TITLE=$(head -n 1 "$CHANGELOG_PATH") + BODY=$(tail -n +2 "$CHANGELOG_PATH") + echo "$TITLE" > "$CHANGELOG_PATH" + echo "" >> "$CHANGELOG_PATH" + echo "$HOTFIX_ENTRY" >> "$CHANGELOG_PATH" + echo "$BODY" >> "$CHANGELOG_PATH" echo "✅ Added CHANGELOG entry for hotfix $HOTFIX_VERSION" else