-
Notifications
You must be signed in to change notification settings - Fork 153
35 lines (31 loc) · 1 KB
/
Copy pathsonar.yml
File metadata and controls
35 lines (31 loc) · 1 KB
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
name: Sonar
on:
# `workflow_run` runs in the context of the base repository,
# allowing it to access secrets even from forked pull requests.
# This enables us to trigger a SonarCloud analysis for all PRs.
workflow_run:
workflows: [ Build ]
types:
- completed
env:
JAVA_VERSION: 21
JAVA_DISTRIBUTION: temurin
jobs:
sonar:
name: Sonar analysis
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
actions: read # Required to download artifacts
steps:
# Must check out for custom same-repository actions to work
- name: Checkout Code
uses: actions/checkout@v6
- name: Perform Sonar analysis
uses: ./.github/actions/sonar-fork-analysis
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
sonar-token: ${{ secrets.SONAR_TOKEN }}
additional-flags: -Psonar-cloud