Skip to content

Commit f447055

Browse files
Gnathonicclaude
andcommitted
fix(ci): extract release notes for bracketed changelog headers
The awk range's end pattern (## [digit) also matched the version's own header, collapsing the range to a single line — so release notes were always empty and had to be written by hand. Replace with a flag-based scan that prints the body between this version's header and the next, handling both '## 1.2.3' and '## [1.2.3]' styles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c67ce31 commit f447055

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,15 @@ jobs:
5555
id: release_notes
5656
run: |
5757
VERSION="${{ steps.version_check.outputs.current_version }}"
58-
# Extract content between this version header and the next version header
59-
NOTES=$(awk "/^## $VERSION/,/^## \[?[0-9]/" CHANGELOG.md | head -n -1 | tail -n +2)
58+
# Print the body between this version's header and the next version header,
59+
# excluding both headers. Handles both "## 1.2.3" and "## [1.2.3]" styles.
60+
# (The old awk range failed because its end pattern also matched the start
61+
# header, collapsing the range to a single line — release notes were empty.)
62+
NOTES=$(awk -v ver="$VERSION" '
63+
$0 ~ "^## \\[?" ver "([^0-9]|$)" { collecting = 1; next }
64+
collecting && /^## \[?[0-9]/ { exit }
65+
collecting { print }
66+
' CHANGELOG.md)
6067
# Use a delimiter for multiline output
6168
echo "notes<<EOF" >> $GITHUB_OUTPUT
6269
echo "$NOTES" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)