diff --git a/forgejo-release.sh b/forgejo-release.sh index 5ba1c6e..ef6f3cd 100755 --- a/forgejo-release.sh +++ b/forgejo-release.sh @@ -84,7 +84,7 @@ upload_release() { # It is expanded using "${assets[@]}" which preserves the separation of arguments and not split whitespace containing values. # For reference, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions local assets=() - for file in "$RELEASE_DIR"/*; do + [ -n "$RELEASE_DIR" ] && [ -d "$RELEASE_DIR" ] && for file in "$RELEASE_DIR"/*; do assets=("${assets[@]}" -a "$file") done if $PRERELEASE || echo "${TAG}" | grep -qi '\-rc'; then