You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# SonarQube Server Quality Gate check [](https://github.com/SonarSource/sonarqube-quality-gate-action/actions/workflows/run-qa.yml)
2
2
3
-
Check the Quality Gate of your code with [SonarQube](https://www.sonarqube.org/) to ensure your code meets your own quality standards before you release or deploy new features.
3
+
Check the Quality Gate of your code with [SonarQube Server](https://www.sonarsource.com/products/sonarqube/) to ensure your code meets your own quality standards before you release or deploy new features.
4
4
5
5
<imgsrc="./images/SonarQube-72px.png">
6
6
7
-
SonarQube is the leading product for Continuous Code Quality & Code Security. It supports most popular programming languages, including Java, JavaScript, TypeScript, C#, Python, C, C++, and many more.
7
+
SonarQube Server is the leading product for Continuous Code Quality & Code Security. It supports most popular programming languages, including Java, JavaScript, TypeScript, C#, Python, C, C++, and many more.
8
8
9
9
## Requirements
10
10
@@ -19,44 +19,43 @@ The workflow YAML file will usually look something like this::
19
19
```yaml
20
20
on:
21
21
# Trigger analysis when pushing in master or pull requests, and when creating
22
-
# a pull request.
22
+
# a pull request.
23
23
push:
24
24
branches:
25
25
- master
26
26
pull_request:
27
-
types: [opened, synchronize, reopened]
27
+
types: [opened, synchronize, reopened]
28
28
name: Main Workflow
29
29
jobs:
30
30
sonarqube:
31
31
runs-on: ubuntu-latest
32
32
steps:
33
-
- uses: actions/checkout@v3
34
-
with:
35
-
# Disabling shallow clone is recommended for improving relevancy of reporting.
36
-
fetch-depth: 0
37
-
38
-
# Triggering SonarQube analysis as results of it are required by Quality Gate check.
- `SONAR_TOKEN` – **Required** this is the token used to authenticate access to SonarQube. You can read more about security tokens [here](https://docs.sonarqube.org/latest/user-guide/user-token/). You can set the `SONAR_TOKEN` environment variable in the "Secrets" settings page of your repository, or you can add them at the level of your GitHub organization (recommended).
82
+
- `SONAR_TOKEN`– **Required** this is the token used to authenticate access to SonarQube Server. You can read more about security tokens [here](https://docs.sonarqube.org/latest/user-guide/user-token/). You can set the `SONAR_TOKEN` environment variable in the "Secrets" settings page of your repository, or you can add them at the level of your GitHub organization (recommended).
84
83
85
-
- `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).
84
+
- `SONAR_HOST_URL`– **Optional** this tells the scanner where SonarQube Server 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).
86
85
87
-
- `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).
86
+
- `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).
fail "Quality Gate has FAILED.${reset}\n\n${analysisResultMsg}"
78
78
else
79
79
set_output "quality-gate-status""FAILED"
80
-
fail "Quality Gate not set for the project. Please configure the Quality Gate in SonarQube or remove sonarqube-quality-gate action from the workflow."
80
+
fail "Quality Gate not set for the project. Please configure the Quality Gate in SonarQube Server or remove sonarqube-quality-gate action from the workflow."
[[ "$output"=*"Quality Gate not set for the project. Please configure the Quality Gate in SonarQube or remove sonarqube-quality-gate action from the workflow."* ]]
105
+
[[ "$output"=*"Quality Gate not set for the project. Please configure the Quality Gate in SonarQube Server or remove sonarqube-quality-gate action from the workflow."* ]]
106
106
}
107
107
108
108
@test "fail when polling timeout is reached" {
@@ -119,7 +119,7 @@ teardown() {
119
119
run script/check-quality-gate.sh metadata_tmp 5
120
120
121
121
[ "$status"-eq 1 ]
122
-
[[ "$output"=*"Polling timeout reached for waiting for finishing of the Sonar scan! Aborting the check for SonarQube's Quality Gate."* ]]
122
+
[[ "$output"=*"Polling timeout reached for waiting for finishing of the Sonar scan! Aborting the check for SonarQube Server's Quality Gate."* ]]
0 commit comments