Sonar Scan #1281
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sonar Scan | |
on: | |
workflow_run: | |
workflows: [ PR Checks, Main CI ] | |
types: | |
- completed | |
jobs: | |
sonar-scan: | |
name: Sonar Scan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download coverage report | |
uses: actions/[email protected] | |
with: | |
run-id: ${{ github.event.workflow_run.id }} | |
github-token: ${{ github.token }} | |
name: coverage-results | |
path: coverage | |
- name: SonarCloud Scan | |
id: sonarcloud-scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.verbose=false | |
-Dsonar.branch.name=${{ github.head_ref || github.ref_name }} | |
- name: SonarCloud Quality Gate Check | |
id: sonarqube-quality-gate-check | |
if: ${{ always() && steps.sonarcloud-scan.conclusion == 'success' }} | |
uses: sonarsource/sonarqube-quality-gate-action@master | |
with: | |
pollingTimeoutSec: 600 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Quality Gate Status | |
run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}" |