Skip to content

Commit c6abde3

Browse files
authored
fix(ci): improve prerelease changelog #4082
Problem: The prerelease changelog might include items from the previous release, or omit some items if the current changelog is very long. Solution: Use `perl` instead of `head` to get only the first section. before: ## 1.99.0 2023-11-17 - ... - ... ## 1.98.0 2023-11-09 - ... after: ## 1.99.0 2023-11-17 - ... - ...
1 parent 3d64510 commit c6abde3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
echo "tagname=$TAG_NAME" >> $GITHUB_OUTPUT
7070
echo "version=$(grep -m 1 version package.json | grep -o '[0-9][^\"]\+' | sed 's/-SNAPSHOT//')" >> $GITHUB_OUTPUT
7171
echo 'changes<<EOF' >> $GITHUB_OUTPUT
72-
head -14 CHANGELOG.md >> $GITHUB_OUTPUT
72+
cat CHANGELOG.md | perl -ne 'BEGIN{$/="\n\n"} print; exit if $. == 2' >> $GITHUB_OUTPUT
7373
echo 'EOF' >> $GITHUB_OUTPUT
7474
7575
publish:
@@ -83,6 +83,9 @@ jobs:
8383
FEAT_NAME: ${{ needs.package.outputs.feature }}
8484
TAG_NAME: ${{ needs.package.outputs.tagname }}
8585
AWS_TOOLKIT_VERSION: ${{ needs.package.outputs.version }}
86+
# Used in release_notes.md
87+
BRANCH: ${{ github.ref_name }}
88+
# Used in release_notes.md
8689
AWS_TOOLKIT_CHANGES: ${{ needs.package.outputs.changes }}
8790
permissions:
8891
contents: write

.github/workflows/release_notes.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_This is an **unsupported preview build** of AWS Toolkit, for testing new features._
1+
_This is an **unsupported preview build** of the `${BRANCH}` branch of AWS Toolkit._
22

33
# Install
44

@@ -8,3 +8,7 @@ _This is an **unsupported preview build** of AWS Toolkit, for testing new featur
88
# Changes
99

1010
${AWS_TOOLKIT_CHANGES}
11+
12+
## Previous changes
13+
14+
- See [CHANGELOG.md](CHANGELOG.md)

0 commit comments

Comments
 (0)