Skip to content

Sonar Scan

Sonar Scan #1281

Workflow file for this run

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 }}"