diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index 8e9e91b1f..f36566dda 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -69,6 +69,11 @@ dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { if ($noErrors) { Write-Output "::error file=$file,line=$line,col=$column::$message" } } +if ($noErrors -and !$?) +{ + exit 1 +} + # With node reuse, dotnet build spawns processes that while speed up build, they can cause dotnet test and other dotnet # tools to randomly hang. So, here we shut down those processes for later actions. # For details see: https://github.com/Lombiq/UI-Testing-Toolbox/issues/228.