Fix wrong interpolation of github auth token.
Thanks to @jamezilla for noticing this.
This commit is contained in:
parent
083a6b5c17
commit
935afbfd6a
9
run
9
run
|
@ -7,14 +7,11 @@ GREP_OPTIONS=""
|
||||||
|
|
||||||
function perform_curl {
|
function perform_curl {
|
||||||
if [[ ! -z "$GITHUB_ACCESS_TOKEN" ]]; then
|
if [[ ! -z "$GITHUB_ACCESS_TOKEN" ]]; then
|
||||||
REQUEST_HEADER="-H 'Authorization: token ${GITHUB_ACCESS_TOKEN}'"
|
CURL_OPTIONS=(-H "Authorization: token $GITHUB_ACCESS_TOKEN")
|
||||||
echo "$REQUEST_HEADER"
|
|
||||||
fi
|
fi
|
||||||
echo "$1"
|
|
||||||
|
|
||||||
DOWNLOAD_URL=$(curl "$REQUEST_HEADER" "$1" | grep -oe '"browser_download_url":\s*"[^" ]*"' | grep -oe 'http[^" ]*' | grep "$FILE_NAME" | head -1)
|
DOWNLOAD_URL=$(curl "${CURL_OPTIONS[@]}" "$1" | grep -oe '"browser_download_url":\s*"[^" ]*"' | grep -oe 'http[^" ]*' | grep "$FILE_NAME" | head -1)
|
||||||
echo "$DOWNLOAD_URL"
|
curl "${CURL_OPTIONS[@]}" -Lo "$FILE_NAME" "$DOWNLOAD_URL"
|
||||||
curl "$REQUEST_HEADER" -Lo "$FILE_NAME" "$DOWNLOAD_URL"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function download_generator {
|
function download_generator {
|
||||||
|
|
Loading…
Reference in New Issue