Skip to content

Commit

Permalink
CI fetch_json: fixed when GITHUB_TOKEN not passed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MartinPulec committed Nov 16, 2023
1 parent dc1ff7d commit 9b855d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Empty file modified .github/scripts/download-gh-asset.sh
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions .github/scripts/json-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9b855d4

Please sign in to comment.