Skip to content

Commit 9b6d0dc

Browse files
committed
Update SonarCloud analysis
- change to the new unified sonarqube-scan-action source: https://github.com/SonarSource/sonarqube-scan-action/?tab=readme-ov-file#cloud-1
1 parent 310ab16 commit 9b6d0dc

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,33 @@
2929
name: SonarCloud analysis
3030

3131
on:
32+
# Trigger analysis when pushing to your main branches, and when creating a pull request.
3233
push:
33-
branches: [ "main" ]
34+
branches:
35+
- main
36+
- 'releases/**'
3437
pull_request:
35-
branches: [ "main" ]
36-
workflow_dispatch:
38+
types: [opened, synchronize, reopened]
3739

3840
permissions:
3941
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
4042

4143
jobs:
42-
Analysis:
44+
sonarqube:
4345
runs-on: ubuntu-latest
44-
4546
steps:
46-
- name: Analyze with SonarCloud
47-
48-
# You can pin the exact commit or the version.
49-
# uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
50-
uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
51-
env:
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information
53-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
47+
- uses: actions/checkout@v4
48+
with:
49+
# Disabling shallow clones is recommended for improving the relevancy of reporting
50+
fetch-depth: 0
51+
- name: SonarQube Scan
52+
uses: SonarSource/sonarqube-scan-action@v5.2.0 # Ex: v4.1.0, See the latest version at https://github.com/marketplace/actions/official-sonarqube-scan
53+
env:
54+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5455
with:
5556
# Additional arguments for the sonarcloud scanner
5657
args:
5758
# Unique keys of your project and organization. You can find them in SonarCloud > Information (bottom-left menu)
5859
# mandatory
5960
-Dsonar.projectKey=MobileID-Strong-Authentication_mobileid-client-java
6061
-Dsonar.organization=mobileid-strong-authentication
61-
# Comma-separated paths to directories containing main source files.
62-
#-Dsonar.sources= # optional, default is project base directory
63-
# When you need the analysis to take place in a directory other than the one from which it was launched
64-
#-Dsonar.projectBaseDir= # optional, default is .
65-
# Comma-separated paths to directories containing test source files.
66-
#-Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/
67-
# Adds more detail to both client and server-side analysis logs, activating DEBUG mode for the scanner, and adding client-side environment variables and system properties to the server-side log of analysis report processing.
68-
#-Dsonar.verbose= # optional, default is false

0 commit comments

Comments
 (0)