From 4373302549ad46eb3859cdadb222f2a81a60e8f8 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Fri, 22 Nov 2024 12:57:31 -0500 Subject: [PATCH] ci: fix existing_version_check false positives (#11327) b/370046361 --- generation/check_existing_release_versions.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/generation/check_existing_release_versions.sh b/generation/check_existing_release_versions.sh index 182d1f54c29d..68f1d32afe20 100755 --- a/generation/check_existing_release_versions.sh +++ b/generation/check_existing_release_versions.sh @@ -29,13 +29,12 @@ function find_existing_version_pom() { local group_id_dir="${group_id//\.//}" local URL="${MAVEN_SITE}/${group_id_dir}/${artifact_id}/${version}/${artifact_id}-${version}.pom" local status_code=$(curl --silent --head -o /dev/null -w "%{http_code}" $URL) - if [ "${status_code}" == "404" ]; then - echo " The version does not exists. Good" - else + if [ "${status_code}" == "200" ]; then echo " The version already exists at ${URL}. Please investigate." return_code=1 + else + echo " The version does not exists (status_code ${status_code} for ${URL}). Good." fi - } return_code=0