ci: Use the latest tag for SonarCloud versioning

Configure SonarCloud to use the latest git tag as the version identifier
instead of the current commit. This ensures that SonarCloud considers
all code changes since the last tagged release, aligning with our setup
to track new code issues from the most recent release.
pull/254/head
Robert Dailey 4 months ago
parent 71f4823ff4
commit 80a9376287

@ -20,14 +20,11 @@ jobs:
sonarcloud: sonarcloud:
name: SonarCloud name: SonarCloud
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
DOTNET_ROLL_FORWARD: LatestMajor
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- name: Get Source Code - name: Get Source Code
uses: actions/checkout@v4 uses: actions/checkout@v4
with: 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 # GH Runners come with Java 11, which is deprecated by Sonarcloud
- name: Setup Java - name: Setup Java

@ -6,8 +6,9 @@ param (
[switch] $Details [switch] $Details
) )
$version = $(dotnet gitversion /showvariable semver) # We use the current released version because we want to treat all code written since that version
if ($LASTEXITCODE -ne 0) { throw "Failed: dotnet gitversion" } # as 'new' for analysis purposes.
$version = (git describe --tags --abbrev=0) -replace '^v'
$beginArgs = @( $beginArgs = @(
"-o:recyclarr" "-o:recyclarr"

Loading…
Cancel
Save