Skip to content

Commit 7085bb0

Browse files
committed
update workflows
1 parent 29d6d39 commit 7085bb0

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
with:
6969
tag_name: v${{ env.VERSION }}
7070
name: Release v${{ env.VERSION }}
71-
body: "Automated release of version ${{ env.VERSION }}"
71+
body: ${{ github.event.pull_request.body || format('Automated release of version {0}', env.VERSION) }}
7272
files: |
7373
target/*.jar
7474

‎.github/workflows/version.yml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,31 @@ jobs:
9595
echo "VERSION=$VERSION" >> $GITHUB_ENV
9696
echo "New version: $VERSION"
9797
98+
- name: Update CHANGELOG.md
99+
run: |
100+
ENTRY_FILE=$(mktemp)
101+
printf "## %s\n%s\n\n" "$VERSION" "$BODY" > "$ENTRY_FILE"
102+
103+
awk -v newfile="$ENTRY_FILE" '
104+
BEGIN { fm=0; done=0 }
105+
{
106+
print
107+
if ($0 == "---") {
108+
fm++
109+
if (fm == 2 && !done) {
110+
print ""
111+
while ((getline line < newfile) > 0) print line
112+
done=1
113+
}
114+
}
115+
}
116+
' CHANGELOG.md > /tmp/CHANGELOG.new
117+
118+
mv /tmp/CHANGELOG.new CHANGELOG.md
119+
120+
# bump the index in the frontmatter to match the new entry count
121+
sed -i "0,/^index: [0-9]*/s//index: $(( $(grep -c '^## ' CHANGELOG.md) ))/" CHANGELOG.md
122+
98123
- name: Delete changeset files
99124
run: |
100125
find .changeset -type f ! -name 'README.md' -delete

0 commit comments

Comments
 (0)