-
Notifications
You must be signed in to change notification settings - Fork 16
33 lines (29 loc) · 941 Bytes
/
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
name: SonarCloud PR Analysis
on:
pull_request:
branches:
- '**' # Trigger on pull requests targeting any branch
jobs:
sonarcloud:
name: Sonar Analysis
runs-on: ubuntu-latest
needs: test-build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full history is fetched for accurate analysis
- name: Download coverage artifact
uses: actions/download-artifact@v4
with:
name: coverage
path: coverage
- name: SonarCloud Scan
uses: sonarsource/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.head_ref }}
-Dsonar.pullrequest.base=${{ github.base_ref }}