From c9506a44472d25041e1ef26de5daf6a95cfba2d1 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 13 Sep 2022 12:11:14 -0700 Subject: [PATCH] Update Bazel latest version heuristic. (#30958) GitHub has changed their releases pages to not use full server-side rendering. Instead, individual artifacts are now fetched as a separate HTML chunk via javascript. This defeats the previous method. Instead, we now rely on the URI of the 301 redirect to indicate the identity of the latest release. --- test/distrib/bazel/test_latest_bazel_version.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/distrib/bazel/test_latest_bazel_version.sh b/test/distrib/bazel/test_latest_bazel_version.sh index fb02a86c5fb..1f47ab94d20 100755 --- a/test/distrib/bazel/test_latest_bazel_version.sh +++ b/test/distrib/bazel/test_latest_bazel_version.sh @@ -20,8 +20,8 @@ cd "$(dirname "$0")" GITHUB_URL="https://github.com" REPO="bazelbuild/bazel" -VERSION=$(curl -Ls "${GITHUB_URL}/${REPO}/releases/latest" | \ - grep "href=.*\.tar.gz" | \ - grep -o "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*") +VERSION=$(curl -v "${GITHUB_URL}/${REPO}/releases/latest" 2>/dev/stdout | \ + grep "location:" | \ + grep -o "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*") ./test_single_bazel_version.sh "$VERSION"