Skip to content

Commit 0224c0c

Browse files
committed
Better changelog formatting
1 parent 7f70730 commit 0224c0c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,17 @@ jobs:
197197
notes="First release."
198198
else
199199
log=$(git log "$prev".."$currentCommit" --pretty=format:'* %h %s' | head -n200)
200-
if [[ -z "$log" ]]; then notes="No commit differences from $prev."; else notes="Changes since $prev:\n$log"; fi
200+
if [[ -z "$log" ]]; then
201+
notes="No commit differences from $prev."
202+
else
203+
notes=$'Changes since '$prev':\n'
204+
notes+="$log"
205+
fi
201206
fi
202-
safe=$(echo "$notes" | sed ':a;N;$!ba;s/\r//g' | sed 's/$/%0A/'); safe=${safe%%%0A}
203-
echo "changelog=$safe" >> $GITHUB_OUTPUT
207+
echo "$notes" | sed ':a;N;$!ba;s/\r//g' > changelog.txt
208+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
209+
cat changelog.txt >> $GITHUB_OUTPUT
210+
echo "EOF" >> $GITHUB_OUTPUT
204211
- name: Create release
205212
env:
206213
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)