File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,18 +100,16 @@ jobs:
100100 COMMITS="- Initial release"
101101 fi
102102
103- # Create new changelog entry
104- {
105- head -n 8 CHANGELOG.md
106- echo ""
107- echo "## [${{ steps.version.outputs.version }}] - $DATE"
108- echo ""
109- echo "### Changes"
110- echo ""
111- echo "$COMMITS"
112- echo ""
113- tail -n +9 CHANGELOG.md
114- } > CHANGELOG.md.tmp
103+ # Create new changelog entry — insert after the marker comment
104+ NEW_ENTRY=$(printf '%s\n' \
105+ "" \
106+ "## [${{ steps.version.outputs.version }}] - $DATE" \
107+ "" \
108+ "### Changed" \
109+ "" \
110+ "$COMMITS")
111+
112+ awk -v entry="$NEW_ENTRY" '/<!-- insert new changelog below this comment -->/ { print; print entry; next } {print}' CHANGELOG.md > CHANGELOG.md.tmp
115113 mv CHANGELOG.md.tmp CHANGELOG.md
116114
117115 echo "✅ Updated CHANGELOG.md with commits since $PREVIOUS_TAG"
You can’t perform that action at this time.
0 commit comments