-
Notifications
You must be signed in to change notification settings - Fork 10
47 lines (42 loc) · 1.37 KB
/
sonar.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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 }}"