Skip to content

Commit 953fcf9

Browse files
Sync eng/common directory with azure-sdk-tools for PR 12337 (#36113)
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#12337 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) Co-authored-by: Daniel Jurek <[email protected]>
1 parent 259da84 commit 953fcf9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

eng/common/scripts/Helpers/CommandInvocation-Helpers.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ function Invoke-LoggedCommand
5454
if($LastExitCode -notin $AllowedExitCodes)
5555
{
5656
LogError "Command failed to execute ($duration): $Command`n"
57+
58+
# This fix reproduces behavior that existed before
59+
# https://github.com/Azure/azure-sdk-tools/pull/12235
60+
# Before that change, if a command failed Write-Error was always
61+
# invoked in the failure case. Today, LogError only does Write-Error
62+
# when running locally (not in a CI environment)
63+
if ((Test-SupportsDevOpsLogging) -or (Test-SupportsGitHubLogging)) {
64+
Write-Error "Command failed to execute ($duration): $Command`n"
65+
}
5766
}
5867
else {
5968
Write-Host "Command succeeded ($duration)`n"

0 commit comments

Comments
 (0)