diff --git a/.azuredevops/Pipelines/Templates/prepare-code-analysis.yaml b/.azuredevops/Pipelines/Templates/prepare-code-analysis.yaml index d2428587..d261d5c4 100644 --- a/.azuredevops/Pipelines/Templates/prepare-code-analysis.yaml +++ b/.azuredevops/Pipelines/Templates/prepare-code-analysis.yaml @@ -9,4 +9,6 @@ steps: projectName: RepoM extraProperties: | sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx - sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml \ No newline at end of file + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml + condition: or( ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.PullRequest.IsFork'], 'false') ) + \ No newline at end of file diff --git a/.azuredevops/Pipelines/Templates/publish-code-analysis.yaml b/.azuredevops/Pipelines/Templates/publish-code-analysis.yaml index 9e5a9e65..8e6deaa0 100644 --- a/.azuredevops/Pipelines/Templates/publish-code-analysis.yaml +++ b/.azuredevops/Pipelines/Templates/publish-code-analysis.yaml @@ -2,9 +2,11 @@ steps: - task: SonarCloudAnalyze@2 displayName: ⚙️ Run Code Analysis + condition: or( ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.PullRequest.IsFork'], 'false') ) - task: SonarCloudPublish@2 displayName: 📢 Publish Quality Gate Result + condition: or( ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.PullRequest.IsFork'], 'false') ) - pwsh: | dotnet tool install --tool-path . dotnet-reportgenerator-globaltool