mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 06:40:15 +00:00
gh/scripts/download-gh-asset.sh: use $GITHUB_TOKEN
Use $GITHUB_TOKEN if provided (it is in the CI) to get around API rate limiting (it already is used by the curl calls made by fetch_json function).
This commit is contained in:
7
.github/scripts/download-gh-asset.sh
vendored
7
.github/scripts/download-gh-asset.sh
vendored
@@ -21,5 +21,10 @@ gh_path_json=$(fetch_json "$gh_release" "${GITHUB_TOKEN-}" array)
|
||||
gh_path=$(jq -r '[.[] | select(.name | test(".*'"$pattern"'.*"))] |
|
||||
.[0].browser_download_url' "$gh_path_json")
|
||||
rm -- "$gh_path_json"
|
||||
curl -sSL "$gh_path" -o "$file"
|
||||
if [ -n "${GITHUB_TOKEN-}" ]; then
|
||||
set -- -H "Authorization: token $GITHUB_TOKEN"
|
||||
else
|
||||
set --
|
||||
fi
|
||||
curl -sSL "$@" "$gh_path" -o "$file"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user