Skip to content

Commit

Permalink
Update pipeline to run SonarCloud tasks when succeeded() and not a PR…
Browse files Browse the repository at this point in the history
… from a fork (#144)
  • Loading branch information
coenm authored Sep 4, 2024
1 parent 89d2ed9 commit 73de955
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ steps:
extraProperties: |
sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx
sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml
condition: or( ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.PullRequest.IsFork'], 'false') )
condition: and(succeeded(), or( ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.PullRequest.IsFork'], 'false') ))

4 changes: 2 additions & 2 deletions .azuredevops/Pipelines/Templates/publish-code-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ steps:

- task: SonarCloudAnalyze@2
displayName: ⚙️ Run Code Analysis
condition: or( ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.PullRequest.IsFork'], 'false') )
condition: and(succeeded(), 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') )
condition: and(succeeded(), or( ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.PullRequest.IsFork'], 'false') ))

- pwsh: |
dotnet tool install --tool-path . dotnet-reportgenerator-globaltool
Expand Down

0 comments on commit 73de955

Please sign in to comment.