diff --git a/examples/sonar-scan-example/README.md b/examples/sonar-scan-example/README.md index cb00b89..8e919f6 100644 --- a/examples/sonar-scan-example/README.md +++ b/examples/sonar-scan-example/README.md @@ -11,7 +11,7 @@ should be checked using a policy. ## Environment variables - `SONAR_TOKEN` - The sonar server token. - `SONAR_TYPE` - Should be Either SAAS or SELFHOSTED, defaulting to SAAS. -- `SONAR_HOST_URL` - The sonar server host name, for example sonar.myconpany.org. required for SELFHOSTED type, if not provided for SAAS type sonarcloud.io is used as default. +- `SONAR_HOST_URL` - The sonar server host name, for example https://mysonar.mycorp.com, for example sonar.myconpany.org. required for SELFHOSTED type, if not provided for SAAS type sonarcloud.io is used as default. - `SONAR_PROXY_URL` - The proxy server URL, in the format of http://your-proxy-server:port. or https://username:password@your-proxy-server:port ## Arguments diff --git a/examples/sonar-scan-example/main.go b/examples/sonar-scan-example/main.go index 9275ffe..bf8b3b2 100644 --- a/examples/sonar-scan-example/main.go +++ b/examples/sonar-scan-example/main.go @@ -139,7 +139,7 @@ func main() { logger.Println("WaitTime:", waitTime) } response := SonarResponse{} - defaultSonarHost := "sonarcloud.io" + defaultSonarHost := "https://sonarcloud.io" sonarHost := os.Getenv("SONAR_HOST_URL") if sonar_type == "SAAS" { diff --git a/examples/sonar-scan-example/sonar-helper.go b/examples/sonar-scan-example/sonar-helper.go index 5801442..d31d896 100644 --- a/examples/sonar-scan-example/sonar-helper.go +++ b/examples/sonar-scan-example/sonar-helper.go @@ -14,7 +14,7 @@ import ( ) const ( - SELFHOSTED_ANALYSIS_URL = "https://$sonarhost/api/qualitygates/project_status?analysisId=$analysisId" + SELFHOSTED_ANALYSIS_URL = "$sonarhost/api/qualitygates/project_status?analysisId=$analysisId" ) func runReport(ctx context.Context, logger *log.Logger, sonarHost string, proxyURL string, sonar_token string, reportTaskFile string, failOnAnalysisFailure bool, maxRetries int, waitTime int) (SonarResponse, error) {