Skip to content

Commit ac5bcd9

Browse files
committed
SQQGGHA-9 Use new SonarQube (Server, Cloud) product names
1 parent 07d1da2 commit ac5bcd9

6 files changed

+21
-22
lines changed

README.md

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# SonarQube Quality Gate check [![QA](https://github.com/SonarSource/sonarqube-quality-gate-action/actions/workflows/run-qa.yml/badge.svg)](https://github.com/SonarSource/sonarqube-quality-gate-action/actions/workflows/run-qa.yml)
1+
# SonarQube Server Quality Gate check [![QA](https://github.com/SonarSource/sonarqube-quality-gate-action/actions/workflows/run-qa.yml/badge.svg)](https://github.com/SonarSource/sonarqube-quality-gate-action/actions/workflows/run-qa.yml)
22

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.
44

5-
<img src="./images/SonarQube-72px.png">
5+
<img src="./images/SonarQubeServer.png">
66

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.
88

99
## Requirements
1010

@@ -19,12 +19,12 @@ The workflow YAML file will usually look something like this::
1919
```yaml
2020
on:
2121
# Trigger analysis when pushing in master or pull requests, and when creating
22-
# a pull request.
22+
# a pull request.
2323
push:
2424
branches:
2525
- master
2626
pull_request:
27-
types: [opened, synchronize, reopened]
27+
types: [opened, synchronize, reopened]
2828
name: Main Workflow
2929
jobs:
3030
sonarqube:
@@ -36,27 +36,26 @@ jobs:
3636
fetch-depth: 0
3737

3838
# Triggering SonarQube analysis as results of it are required by Quality Gate check.
39-
- name: SonarQube Scan
39+
- name: SonarQube Server Scan
4040
uses: sonarsource/sonarqube-scan-action@master
4141
env:
4242
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4343
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
4444

4545
# Check the Quality Gate status.
46-
- name: SonarQube Quality Gate check
46+
- name: SonarQube Server Quality Gate check
4747
id: sonarqube-quality-gate-check
4848
uses: sonarsource/sonarqube-quality-gate-action@master
4949
with:
5050
pollingTimeoutSec: 600
5151
env:
52-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
53-
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} #OPTIONAL
52+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
53+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} #OPTIONAL
5454

5555
# Optionally you can use the output from the Quality Gate in another step.
5656
# The possible outputs of the `quality-gate-status` variable are `PASSED`, `WARN` or `FAILED`.
57-
- name: "Example show SonarQube Quality Gate Status value"
57+
- name: "Example show SonarQube Server Quality Gate Status value"
5858
run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}"
59-
6059
```
6160
6261
Make sure to set up `pollingTimeoutSec` property in your step, to avoid wasting action minutes per month (see above example). If not provided, the default value of 300s is applied.
@@ -72,19 +71,19 @@ Typically, report metadata file for different scanners can vary and can be locat
7271
Example usage:
7372

7473
```yaml
75-
- name: SonarQube Quality Gate check
74+
- name: SonarQube Server Quality Gate check
7675
uses: sonarsource/sonarqube-quality-gate-action@master
7776
with:
7877
scanMetadataReportFile: target/sonar/report-task.txt
7978
```
8079

8180
### Environment variables
8281

83-
- `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).
8483

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).
8685

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).
8887

8988
## Quality Gate check run
9089

action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: SonarQube Quality Gate Check
1+
name: SonarQube Server Quality Gate Check
22
description: >
33
Check if a project / analysis passed the Quality Gate check
44
branding:
@@ -16,7 +16,7 @@ inputs:
1616
required: false
1717
default: .scannerwork/report-task.txt
1818
pollingTimeoutSec:
19-
description: "The maximum time (in seconds) to poll for SonarQube's Quality Gate status. Default: 300."
19+
description: "The maximum time (in seconds) to poll for SonarQube Server's Quality Gate status. Default: 300."
2020
required: false
2121
default: "300"
2222
outputs:

images/SonarQube-72px.png

-9.66 KB
Binary file not shown.

images/SonarQubeServer.png

3.89 KB
Loading

script/check-quality-gate.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ done
5555
printf '\n'
5656

5757
if [[ ${status} == "PENDING" || ${status} == "IN_PROGRESS" ]] && [[ ${SECONDS} -ge ${endTime} ]]; then
58-
echo "Polling timeout reached for waiting for finishing of the Sonar scan! Aborting the check for SonarQube's Quality Gate."
58+
echo "Polling timeout reached for waiting for finishing of the Sonar scan! Aborting the check for SonarQube Server's Quality Gate."
5959
exit 1
6060
fi
6161

@@ -77,6 +77,6 @@ elif [[ ${qualityGateStatus} == "ERROR" ]]; then
7777
fail "Quality Gate has FAILED.${reset}\n\n${analysisResultMsg}"
7878
else
7979
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."
8181
fi
8282

test/check-quality-gate-test.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ teardown() {
102102

103103
[ "$status" -eq 1 ]
104104
[[ "${github_out_actual}" = "quality-gate-status=FAILED" ]]
105-
[[ "$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."* ]]
106106
}
107107

108108
@test "fail when polling timeout is reached" {
@@ -119,7 +119,7 @@ teardown() {
119119
run script/check-quality-gate.sh metadata_tmp 5
120120

121121
[ "$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."* ]]
123123
}
124124

125125
@test "fail when Quality Gate status WARN" {

0 commit comments

Comments
 (0)