diff --git a/forgejo-release.sh b/forgejo-release.sh index 7b3a64f..8abb54e 100755 --- a/forgejo-release.sh +++ b/forgejo-release.sh @@ -43,7 +43,10 @@ ensure_tag() { } upload_release() { - local assets=() # Array over string to resolve SC2086, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions + # assets is defined as a list of arguments, where values may contain whitespace and need to be quoted like this -a "my file.txt" -a "file.txt". + # 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 assets=("${assets[@]}" -a "$file") done