File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,6 +150,9 @@ jobs:
150150 run : |
151151 TAG="v$(node -p 'require("./package.json").version')"
152152 VERSION="${TAG#v}"
153+ has_release_notes() {
154+ [[ "$1" =~ [^[:space:]] ]]
155+ }
153156 BODY=$(awk -v ver="$VERSION" '
154157 /^## / {
155158 if (found) exit
@@ -158,7 +161,7 @@ jobs:
158161 }
159162 found { print }
160163 ' CHANGELOG.md)
161- if [ -z "$BODY" ] ; then
164+ if ! has_release_notes "$BODY"; then
162165 BODY=$(awk '
163166 /^##[[:space:]]*\[Unreleased\]/ { found=1; next }
164167 /^## / {
@@ -167,11 +170,11 @@ jobs:
167170 }
168171 found { print }
169172 ' CHANGELOG.md)
170- if [ -n "$BODY" ] ; then
173+ if has_release_notes "$BODY"; then
171174 echo "::notice::No CHANGELOG.md entry for $TAG — using [Unreleased] notes"
172175 fi
173176 fi
174- if [ -z "$BODY" ] ; then
177+ if ! has_release_notes "$BODY"; then
175178 echo "::warning::No CHANGELOG.md entry for $TAG — falling back to auto-generated notes"
176179 gh release create "$TAG" --generate-notes
177180 else
You can’t perform that action at this time.
0 commit comments