mirror of
https://github.com/SonarSource/sonarqube-quality-gate-action.git
synced 2026-09-23 13:38:32 +00:00
Include SONAR_ROOT_CERT option custom TRA certificates (#39)
This commit is contained in:
@@ -84,6 +84,8 @@ Example usage:
|
||||
|
||||
- `SONAR_HOST_URL` – **Optional** this tells the scanner where SonarQube is hosted, otherwise it will get the one from the scan report. You can set the `SONAR_HOST_URL` environment variable in the "Secrets" settings page of your repository, or you can add them at the level of your GitHub organization (recommended).
|
||||
|
||||
- `SONAR_ROOT_CERT` – Holds an additional root certificate (in PEM format) that is used to validate the SonarQube server certificate. You can set the `SONAR_ROOT_CERT` environment variable in the "Secrets" settings page of your repository, or you can add them at the level of your GitHub organization (recommended).
|
||||
|
||||
## Quality Gate check run
|
||||
|
||||
<img src="./images/QualityGate-check-screen.png">
|
||||
|
||||
@@ -27,6 +27,13 @@ if [ -z "${serverUrl}" ] || [ -z "${ceTaskUrl}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -n "${SONAR_ROOT_CERT}" ]]; then
|
||||
echo "Adding custom root certificate to ~/.curlrc"
|
||||
rm -f /tmp/tmpcert.pem
|
||||
echo "${SONAR_ROOT_CERT}" > /tmp/tmpcert.pem
|
||||
echo "--cacert /tmp/tmpcert.pem" >> ~/.curlrc
|
||||
fi
|
||||
|
||||
task="$(curl --location --location-trusted --max-redirs 10 --silent --fail --show-error --user "${SONAR_TOKEN}": "${ceTaskUrl}")"
|
||||
status="$(jq -r '.task.status' <<< "$task")"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user