CI fetch_json: fixed when GITHUB_TOKEN not passed

When GITHUB_TOKEN was not provided, fetch_json didn't work, because it
uses positional arguments ("$@"), which were set only in this case but
not unset otherwise.
This commit is contained in:
Martin Pulec
2023-11-16 13:29:45 +01:00
parent dc1ff7d21b
commit 9b855d4641
2 changed files with 2 additions and 0 deletions

0
.github/scripts/download-gh-asset.sh vendored Normal file → Executable file
View File

View File

@@ -35,6 +35,8 @@ fetch_json() {
req_type=${3-}
if [ -n "$github_token" ]; then
set -- -H "Authorization: token $github_token"
else
set --
fi
status=$(curl -sS "$@" -X GET "$url" -w "%{http_code}" -o "$json")
if ! is_int "$status" || [ "$status" -ne 200 ]; then