Skip to content

Commit c8b2b3d

Browse files
committed
[ci] If no release notes is provided, auto generate them
1 parent c6a77b3 commit c8b2b3d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,18 @@ jobs:
8484
- name: Create GitHub release
8585
id: create_release
8686
run: |
87+
notes="--notes-file \"${{ runner.temp }}/release_body.md\""
88+
# If the notes file is empty, use --generate-notes instead
89+
if ! grep -q "[^[:space:]]" "${{ runner.temp }}/release_body.md"; then
90+
notes="--generate-notes"
91+
fi
8792
prerelease=""
8893
if [ "$IS_PRERELEASE" = true ]; then
8994
prerelease="--prerelease"
9095
fi
9196
gh release create ${{ github.ref }} \
9297
--title "${{ env.RELEASE_NAME }}" \
93-
--notes-file "${{ runner.temp }}/release_body.md" \
98+
$notes \
9499
$prerelease
95100
- name: Build and publish
96101
env:

0 commit comments

Comments
 (0)