diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 564a4c35..048941f6 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -20,14 +20,11 @@ jobs: sonarcloud: name: SonarCloud runs-on: ubuntu-latest - env: - DOTNET_ROLL_FORWARD: LatestMajor - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Get Source Code uses: actions/checkout@v4 with: - fetch-depth: 0 # avoid shallow clone for GitVersion + fetch-depth: 0 # avoid shallow clone for GitVersion and Sonar analysis # GH Runners come with Java 11, which is deprecated by Sonarcloud - name: Setup Java diff --git a/ci/RunSonarScan.ps1 b/ci/RunSonarScan.ps1 index 1e228270..3f7a0097 100644 --- a/ci/RunSonarScan.ps1 +++ b/ci/RunSonarScan.ps1 @@ -6,8 +6,9 @@ param ( [switch] $Details ) -$version = $(dotnet gitversion /showvariable semver) -if ($LASTEXITCODE -ne 0) { throw "Failed: dotnet gitversion" } +# We use the current released version because we want to treat all code written since that version +# as 'new' for analysis purposes. +$version = (git describe --tags --abbrev=0) -replace '^v' $beginArgs = @( "-o:recyclarr"