Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Commit ee2ef3a

Browse files
committed
Remove all leading and trailing newlines from generated release notes
1 parent 297429d commit ee2ef3a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/cd.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ jobs:
2727
run: sed -i 's/^version *=.*/version = "${{ github.event.inputs.version }}"/' pyproject.toml
2828

2929
- name: "Extract version's changelog for release notes and tag message"
30-
# Find the lines between the first `## [<number>` and the second `## [<number>`.
31-
run: sed '1,/^## *\[[0-9]/d;/^## *\[[0-9]/Q' CHANGELOG.md > release_notes.txt
30+
# 1. Find the lines between the first `## [<number>` and the second `## [<number>`.
31+
# 2. Remove all leading and trailing newlines from the output.
32+
run: sed '1,/^## *\[[0-9]/d;/^## *\[[0-9]/Q' CHANGELOG.md | sed -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba' > release_notes.txt
3233

3334
- name: "Set up Python"
3435
id: setup-python

0 commit comments

Comments
 (0)