File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -814,7 +814,8 @@ function MSBuild-Core() {
814814 Write-Host " See log: $buildLog " - ForegroundColor DarkGray
815815 }
816816
817- if ($ci ) {
817+ # When running on Azure Pipelines, override the returned exit code to avoid double logging.
818+ if ($ci -and $env: BUILD_BUILDNUMBER -ne $null ) {
818819 Write-PipelineSetResult - Result " Failed" - Message " msbuild execution failed."
819820 # Exiting with an exit code causes the azure pipelines task to log yet another "noise" error
820821 # The above Write-PipelineSetResult will cause the task to be marked as failure without adding yet another error
Original file line number Diff line number Diff line change @@ -479,7 +479,9 @@ function MSBuild-Core {
479479 # We should not Write-PipelineTaskError here because that message shows up in the build summary
480480 # The build already logged an error, that's the reason it failed. Producing an error here only adds noise.
481481 echo " Build failed with exit code $exit_code . Check errors above."
482- if [[ " $ci " == " true" ]]; then
482+
483+ # When running on Azure Pipelines, override the returned exit code to avoid double logging.
484+ if [[ " $ci " == " true" && -n ${BUILD_BUILDNUMBER:- } ]]; then
483485 Write-PipelineSetResult -result " Failed" -message " msbuild execution failed."
484486 # Exiting with an exit code causes the azure pipelines task to log yet another "noise" error
485487 # The above Write-PipelineSetResult will cause the task to be marked as failure without adding yet another error
You can’t perform that action at this time.
0 commit comments