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:
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

@ -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"

Loading…
Cancel
Save