From 1c3f210848878709c167943349cea3126504881e Mon Sep 17 00:00:00 2001 From: Justin Bradford Date: Tue, 4 Nov 2025 21:52:28 -0800 Subject: [PATCH] bug: Use GITHUB_TOKEN if present in scripts/install_cli.sh (#169) https://github.com/psviderski/uncloud/issues/163 --- scripts/install_cli.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/install_cli.sh b/scripts/install_cli.sh index 6c28fdee..017b6a34 100755 --- a/scripts/install_cli.sh +++ b/scripts/install_cli.sh @@ -21,7 +21,11 @@ print_manual_install() { fetch_latest_version() { api_url="https://api.github.com/repos/${GITHUB_REPO}/releases/latest" - VERSION=$(curl -fsSL "$api_url" | grep -o '"tag_name": "[^"]*' | cut -d'"' -f4) + 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) if [ -z "$VERSION" ]; then echo "Failed to fetch the latest version from GitHub." print_manual_install