Compare commits

...

3 Commits
v2.1 ... v2.2.0

Author SHA1 Message Date
Csaba Feher
540792c588 Revert "SQSCANGHA-28 Support passing args with spaces"
This reverts commit 16be80a080.
2024-06-13 14:04:55 +02:00
Benjamin Raymond
e56fc172a4 SQSCANGHA-37 Update C++/C recommendation adding AutoScan recommendation 2024-06-07 15:40:00 +02:00
Csaba Feher
94ac847096 SQSCANGHA-30 Replace secrets.SONAR_HOST_URL with vars.SONAR_HOST_URL 2024-05-24 10:06:19 +02:00
3 changed files with 8 additions and 10 deletions

View File

@@ -19,13 +19,12 @@ jobs:
- name: Run action with args
uses: ./
with:
args: >-
"-Dsonar.someArg=a value with spaces" -Dsonar.scanner.dumpToFile=./output.properties
args: -Dsonar.someArg=aValue -Dsonar.scanner.dumpToFile=./output.properties
env:
SONAR_HOST_URL: http://not_actually_used
- name: Assert
run: |
./test/assertFileContains ./output.properties "sonar.someArg=a value with spaces"
./test/assertFileContains ./output.properties "sonar.someArg=aValue"
projectBaseDirInputTest:
name: >
'projectBaseDir' input

View File

@@ -54,7 +54,7 @@ jobs:
uses: sonarsource/sonarqube-scan-action@<action version> # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/official-sonarqube-scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
```
If your source code file names contain special characters that are not covered by the locale range of `en_US.UTF-8`, you can configure your desired locale like this:
@@ -64,7 +64,7 @@ If your source code file names contain special characters that are not covered b
uses: sonarsource/sonarqube-scan-action@<action version> # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/official-sonarqube-scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
LC_ALL: "ru_RU.UTF-8"
```
@@ -75,7 +75,7 @@ If your SonarQube server uses a self-signed certificate, you can pass a root cer
uses: sonarsource/sonarqube-scan-action@<action version> # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/official-sonarqube-scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
SONAR_ROOT_CERT: ${{ secrets.SONAR_ROOT_CERT }}
```
@@ -106,7 +106,7 @@ More information about possible analysis parameters can be found in [the documen
### Environment variables
- `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).
- `SONAR_HOST_URL` **Required** this tells the scanner where SonarQube is hosted. 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_HOST_URL` **Required** this tells the scanner where SonarQube is hosted. You can set the `SONAR_HOST_URL` environment variable in the "Variables" 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).
## Alternatives for Java, .NET, and C/C++ projects
@@ -116,7 +116,7 @@ This GitHub Action will not work for all technologies. If you are in one of the
* Your code is built with Maven. Read the documentation about our [Scanner for Maven](https://redirect.sonarsource.com/doc/install-configure-scanner-maven.html).
* Your code is built with Gradle. Read the documentation about our [Scanner for Gradle](https://redirect.sonarsource.com/doc/gradle.html).
* You want to analyze a .NET solution. Read the documentation about our [Scanner for .NET](https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html).
* You want to analyze C/C++ code. Use the [SonarQube C and C++](https://github.com/SonarSource/sonarqube-github-c-cpp) GitHub Action.
* You want to analyze C or C++ code. Starting from SonarQube 10.6, this GitHub Action will scan C and C++ out of the box. If you want to have better control over the scan configuration/setup, you can switch to the [SonarQube C and C++](https://github.com/SonarSource/sonarqube-github-c-cpp) GitHub Action.
## Error cleaning up workspace

View File

@@ -32,6 +32,5 @@ fi
unset JAVA_HOME
eval "args=(${INPUT_ARGS})"
sonar-scanner $debug_flag "-Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR}" "${args[@]}"
sonar-scanner $debug_flag -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} ${INPUT_ARGS}