From 7a785d4d127edef8ec76fbeaa363e0e3b7b40339 Mon Sep 17 00:00:00 2001 From: Jacek Date: Wed, 7 Sep 2022 09:06:24 +0200 Subject: [PATCH] SONAR-16063 Allow trusted redirects --- script/check-quality-gate.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/check-quality-gate.sh b/script/check-quality-gate.sh index 64174e0..9cde12a 100755 --- a/script/check-quality-gate.sh +++ b/script/check-quality-gate.sh @@ -27,19 +27,19 @@ if [ -z "${serverUrl}" ] || [ -z "${ceTaskUrl}" ]; then exit 1 fi -task="$(curl --silent --fail --show-error --user "${SONAR_TOKEN}": "${ceTaskUrl}")" +task="$(curl --location --location-trusted --max-redirs 10 --silent --fail --show-error --user "${SONAR_TOKEN}": "${ceTaskUrl}")" status="$(jq -r '.task.status' <<< "$task")" until [[ ${status} != "PENDING" && ${status} != "IN_PROGRESS" ]]; do printf '.' sleep 5s - task="$(curl --silent --fail --show-error --user "${SONAR_TOKEN}": "${ceTaskUrl}")" + task="$(curl --location --location-trusted --max-redirs 10 --silent --fail --show-error --user "${SONAR_TOKEN}": "${ceTaskUrl}")" status="$(jq -r '.task.status' <<< "$task")" done analysisId="$(jq -r '.task.analysisId' <<< "${task}")" qualityGateUrl="${serverUrl}/api/qualitygates/project_status?analysisId=${analysisId}" -qualityGateStatus="$(curl --silent --fail --show-error --user "${SONAR_TOKEN}": "${qualityGateUrl}" | jq -r '.projectStatus.status')" +qualityGateStatus="$(curl --location --location-trusted --max-redirs 10 --silent --fail --show-error --user "${SONAR_TOKEN}": "${qualityGateUrl}" | jq -r '.projectStatus.status')" if [[ ${qualityGateStatus} == "OK" ]]; then echo '::set-output name=quality-gate-status::PASSED'