From 2e655d870cef27fcead3da36c39016b71e36e1e2 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Tue, 18 Nov 2025 03:31:35 +0000 Subject: [PATCH] chore: extract version from latest redirect in install_cli.sh (#180) --- scripts/install_cli.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/install_cli.sh b/scripts/install_cli.sh index 017b6a34..d125725e 100755 --- a/scripts/install_cli.sh +++ b/scripts/install_cli.sh @@ -20,12 +20,8 @@ print_manual_install() { } fetch_latest_version() { - api_url="https://api.github.com/repos/${GITHUB_REPO}/releases/latest" - auth_header="" - if [ -n "$GITHUB_TOKEN" ]; then - auth_header="Authorization: Bearer $GITHUB_TOKEN" - fi - VERSION=$(curl -fsSL -H "$auth_header" "$api_url" | grep -o '"tag_name": "[^"]*' | cut -d'"' -f4) + latest_url="https://github.com/${GITHUB_REPO}/releases/latest" + VERSION=$(curl -fsSLI -o /dev/null -w '%{url_effective}' "$latest_url" | grep -o 'tag/[^/]*$' | cut -d'/' -f2) if [ -z "$VERSION" ]; then echo "Failed to fetch the latest version from GitHub." print_manual_install