From fb19118c2040cd97874af01b2f85dbf93d7c83b7 Mon Sep 17 00:00:00 2001 From: lwih Date: Wed, 3 Jan 2024 16:43:50 +0100 Subject: [PATCH] Sonar - try checkout repo first --- .github/workflows/sonarcloud.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index e3b51b7d..5c061cb0 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -33,6 +33,7 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + types: [ opened, synchronize, reopened ] workflow_dispatch: permissions: @@ -43,8 +44,12 @@ jobs: runs-on: ubuntu-latest steps: - - name: Analyze with SonarCloud + - uses: actions/checkout@v3 + with: + # Disabling shallow clone is recommended for improving relevancy of reporting + fetch-depth: 0 + - name: Analyze with SonarCloud # You can pin the exact commit or the version. # uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049 uses: SonarSource/sonarcloud-github-action@master @@ -58,12 +63,12 @@ jobs: # mandatory -Dsonar.projectKey=MTES-MCT_rapportnav2 -Dsonar.organization=mtes-mct - -Dsonar.scm.disabled=true + # -Dsonar.scm.disabled=true # Comma-separated paths to directories containing main source files. #-Dsonar.sources= # optional, default is project base directory # When you need the analysis to take place in a directory other than the one from which it was launched #-Dsonar.projectBaseDir= # optional, default is . # Comma-separated paths to directories containing test source files. #-Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/ - # 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. - #-Dsonar.verbose= # optional, default is false + # 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. + -Dsonar.verbose=true # optional, default is false