Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit bbf6843

Browse files
committed
Attempt to extract the changelog entry for the tag
1 parent f297b99 commit bbf6843

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/nightly-build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,35 @@ jobs:
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141

42+
# Extract the latest changelog section
43+
# Pulls everything after the first version header like "= 8.1.0 - ... =" until the next "=" section header or end of file
44+
- name: Extract latest changelog section
45+
id: changelog
46+
run: |
47+
version_line_found=0
48+
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
49+
while IFS= read -r line; do
50+
if [[ $line == =\ *\ = ]]; then
51+
if [[ $version_line_found -eq 1 ]]; then
52+
break
53+
else
54+
version_line_found=1
55+
echo "$line" >> $GITHUB_OUTPUT
56+
fi
57+
elif [[ $version_line_found -eq 1 ]]; then
58+
echo "$line" >> $GITHUB_OUTPUT
59+
fi
60+
done < changelog.txt
61+
echo "EOF" >> $GITHUB_OUTPUT
62+
4263
- name: Create or Update GitHub Release
4364
uses: softprops/action-gh-release@v2
4465
with:
4566
tag_name: Nightly
4667
release_name: "Nightly Build"
4768
prerelease: true
4869
draft: false
70+
body: ${{ steps.changelog.outputs.CHANGELOG }}
4971
files: woocommerce-subscriptions-core.zip
5072
env:
5173
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)