From 9b855d4641fa7f730aa4502ad2fc06baa154fb5e Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 16 Nov 2023 13:29:45 +0100 Subject: [PATCH] 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. --- .github/scripts/download-gh-asset.sh | 0 .github/scripts/json-common.sh | 2 ++ 2 files changed, 2 insertions(+) mode change 100644 => 100755 .github/scripts/download-gh-asset.sh diff --git a/.github/scripts/download-gh-asset.sh b/.github/scripts/download-gh-asset.sh old mode 100644 new mode 100755 diff --git a/.github/scripts/json-common.sh b/.github/scripts/json-common.sh index b57b8dd53..3979ab953 100644 --- a/.github/scripts/json-common.sh +++ b/.github/scripts/json-common.sh @@ -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