mirror of
https://github.com/SonarSource/sonarqube-quality-gate-action.git
synced 2026-10-03 10:21:31 +00:00
Update README.md
This commit is contained in:
1 parent
69d13d616e
commit
68528dc418
1 file changed
+15
-10
@@ -8,11 +8,13 @@ SonarQube is the leading product for Continuous Code Quality & Code Security. It
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
Repository with SonarQube analysis results.
|
A previous step must have run an analysis on your code.
|
||||||
|
|
||||||
|
Read more information on how to analyze your code [here](https://docs.sonarqube.org/latest/analysis/github-integration/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
The workflow, usually declared in `.github/workflows/build.yml`, should look like this:
|
The workflow YAML file will usually look something like this::
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
on:
|
on:
|
||||||
@@ -47,8 +49,16 @@ jobs:
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can change the location of the report metadata file by using the optional `scanMetadataReportFile` input:
|
Make sure to set up `timeout-minutes` property in your step, to avoid wasting action minutes per month (see above example).
|
||||||
|
|
||||||
|
When using this action with [sonarsource/sonarqube-scan](https://github.com/SonarSource/sonarqube-scan-action) action or with [C/C++ code analysis](https://docs.sonarqube.org/latest/analysis/languages/cfamily/) you don't have to provide `scanMetadataReportFile` input, otherwise you should alter the location of it.
|
||||||
|
|
||||||
|
Typically, report metadata file for different scanners can vary and can be located in:
|
||||||
|
- `target/sonar/report-task.txt` for Maven projects
|
||||||
|
- `build/sonar/report-task.txt` for Gradle projects
|
||||||
|
- `.sonarqube/out/.sonar/report-task.txt` for .NET projects
|
||||||
|
|
||||||
|
Example usage:
|
||||||
```yaml
|
```yaml
|
||||||
uses: sonarsource/sonarqube-quality-gate-action@master
|
uses: sonarsource/sonarqube-quality-gate-action@master
|
||||||
with:
|
with:
|
||||||
@@ -57,20 +67,15 @@ with:
|
|||||||
|
|
||||||
### Environment variables
|
### Environment variables
|
||||||
|
|
||||||
- `SONAR_TOKEN` – **Required** – this token is used to authenticate access to SonarQube. You can read more about security tokens [here](https://docs.sonarqube.org/latest/user-guide/user-token/). You need to set the `SONAR_TOKEN` environment variable in the "Secrets" settings page of your repository.
|
- `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).
|
||||||
|
|
||||||
## Quality Gate check run
|
## Quality Gate check run
|
||||||
|
|
||||||
<img src="./images/QualityGate-check-screen.png">
|
<img src="./images/QualityGate-check-screen.png">
|
||||||
|
|
||||||
## Do not use this GitHub action if you are in the following situations
|
|
||||||
|
|
||||||
* You want to analyze a .NET solution. Read the documentation about our [Scanner for .NET](https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-msbuild/).
|
|
||||||
* You want to analyze C/C++ code. Read the documentation on [analyzing C/C++ code](https://docs.sonarqube.org/latest/analysis/languages/cfamily/).
|
|
||||||
|
|
||||||
## Have questions or feedback?
|
## Have questions or feedback?
|
||||||
|
|
||||||
To provide feedback (request a feature or report a bug), please post on the [SonarSource Community Forum](https://community.sonarsource.com/) with the tag `sonarqube`.
|
To provide feedback (requesting a feature or reporting a bug) please post on the [SonarSource Community Forum](https://community.sonarsource.com/tags/c/help/sq/github-actions).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user