Hello, getting the warning for .net core library project from the “SonarCloudPublish” azure pipeline task , both on the PRs and branches. We use sonar cloud.
Pipeline here:
parameters:
- name: PathToVSSolutionFile #path to .sln file
type: string
default: null
- name: NuGetProjectFiles #array of csproj files for which the negets will be built, pack and published to the PNP/PangeaNugetAzure Azre artefact server
type: object
default: []
- name: SonarCloudProjectKey #identifier of the project in the https://sonarcloud.io/projects
type: string
default: null
stages:
- stage: First
displayName: FirstStage
jobs:
- job: FirstJob
variables:
packagesToPublish: "job level environment var - the value is set in the NugetPackaging task"
pool:
vmImage: ubuntu-latest
steps:
- task: PowerShell@2
displayName: Build REASON
inputs:
targetType: inline
script: |
Write-Host '$(Build.Reason)'
- task: SonarCloudPrepare@1
displayName: 'Code Analysis - Begin (PR)'
#condition: eq(variables['Build.Reason'], 'PullRequest')
inputs:
SonarCloud: 'SonarCloudPNPProject'
organization: 'pangeadigital'
scannerMode: 'MSBuild'
projectKey: ${{ parameters.SonarCloudProjectKey }}
- task: UseDotNet@2
displayName: "Use .NET Core sdk"
inputs:
packageType: sdk
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet tool install --global GitVersion.Tool --version 5.8.1
- script: dotnet gitversion /output json /nofetch
- script: dotnet gitversion /output buildserver /nofetch
- script: dotnet build ${{parameters.PathToVSSolutionFile}} -c Release /p:Version='$(GitVersion.NuGetVersion)'
- task: SonarCloudAnalyze@1
- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'