Skip to content

Commit

Permalink
ci: handle empty changelog in release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Jul 20, 2023
1 parent d138f23 commit 107d18a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@ jobs:
run: |
version=$(cat version.txt | xargs)
title="pywatershed $version"
notes=$(cat "changelog/CHANGELOG_$version.md" | grep -v "### Version $version")
# don't fail if the changelog is empty
if [[ -s "changelog/CHANGELOG_$version.md" ]]; then
notes=$(cat "changelog/CHANGELOG_$version.md" | grep -v "### Version $version")
else
notes="No changes found, are recent commits conventional?"
fi
gh release create "$version" \
--target main \
--title "$title" \
Expand Down

0 comments on commit 107d18a

Please sign in to comment.