Skip to content

Commit

Permalink
token doesn't werk =(
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Nov 23, 2023
1 parent 4f39205 commit 5550628
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@ verifyOpenssl() {
# setDesiredVersion sets the desired version either to an explicit version provided by a user
# or to the latest release available on github releases
setDesiredVersion() {
auth_header="Authorization: Bearer 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"
if [ "x$DESIRED_VERSION" == "x" ]; then
# when desired version is not provided
# get latest tag from the gh releases
if type "curl" &>/dev/null; then
local latest_release_url=$(curl -s --header "${auth_header}" https://api.github.com/repos/$REPO_NAME/releases/latest | sed '5q;d' | cut -d '"' -f 4)
local latest_release_url=$(curl -s https://api.github.com/repos/$REPO_NAME/releases/latest | sed '5q;d' | cut -d '"' -f 4)
if [ -z "$latest_release_url" ]; then
echo "Failed to retrieve latest release URL due to rate limiting. Please try again later."
exit 1
Expand All @@ -114,7 +113,7 @@ setDesiredVersion() {
TAG_WO_VER=$(echo "${TAG}" | cut -c 2-)
elif type "wget" &>/dev/null; then
# get latest release info and get 5th line out of the response to get the URL
local latest_release_url=$(wget -q --header="${auth_header}" https://api.github.com/repos/$REPO_NAME/releases/latest -O- | sed '5q;d' | cut -d '"' -f 4)
local latest_release_url=$(wget -q https://api.github.com/repos/$REPO_NAME/releases/latest -O- | sed '5q;d' | cut -d '"' -f 4)
if [ -z "$latest_release_url" ]; then
echo "Failed to retrieve latest release URL due to rate limiting. Please try again later."
exit 1
Expand Down

0 comments on commit 5550628

Please sign in to comment.