Skip to content

Commit 42f4c34

Browse files
kiyotisclaude
andcommitted
fix: Fix CHANGELOG newline formatting in GitHub Action
Replace sed command with heredoc approach to properly format newlines in CHANGELOG.md. The previous sed command was outputting literal \n characters instead of actual newlines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 483f004 commit 42f4c34

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

‎.github/workflows/sync-to-nabledge.yml‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,27 @@ jobs:
6767
DATE=$(date +%Y-%m-%d)
6868
6969
# Append sync entry to nabledge-6 plugin CHANGELOG
70-
sed -i "/^# Changelog/a \\\n## [Unreleased] - ${DATE}\\\n\\\n### Changed\\\n- Synced from: ${TRIGGER_COMMIT_URL}\\\n" nabledge-repo/plugins/nabledge-6/CHANGELOG.md
70+
CHANGELOG_FILE="nabledge-repo/plugins/nabledge-6/CHANGELOG.md"
71+
TEMP_FILE=$(mktemp)
72+
73+
# Read first line (# Changelog)
74+
head -n 1 "$CHANGELOG_FILE" > "$TEMP_FILE"
75+
76+
# Add new unreleased section
77+
cat >> "$TEMP_FILE" <<EOF
78+
79+
## [Unreleased] - ${DATE}
80+
81+
### Changed
82+
- Synced from: ${TRIGGER_COMMIT_URL}
83+
84+
EOF
85+
86+
# Append rest of original file
87+
tail -n +2 "$CHANGELOG_FILE" >> "$TEMP_FILE"
88+
89+
# Replace original file
90+
mv "$TEMP_FILE" "$CHANGELOG_FILE"
7191

7292
- name: Validate marketplace structure
7393
run: |

0 commit comments

Comments
 (0)