Skip to content

Commit 1998f3b

Browse files
Add better error handling in Prepare-Release (Azure#18590)
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
1 parent 11008ec commit 1998f3b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

eng/common/scripts/Prepare-Release.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ if ($null -eq $newVersionParsed)
136136
-packageType $packageProperties.SDKType `
137137
-packageNewLibrary $packageProperties.IsNewSDK
138138

139+
if ($LASTEXITCODE -ne 0) {
140+
Write-Error "Updating of the Devops Release WorkItem failed."
141+
exit 1
142+
}
143+
139144
if ($releaseTrackingOnly)
140145
{
141146
Write-Host

eng/common/scripts/Update-DevOps-Release-WorkItem.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ param(
1919
Set-StrictMode -Version 3
2020

2121
if (!(Get-Command az -ErrorAction SilentlyContinue)) {
22-
Write-Host 'You must have the Azure CLI installed: https://aka.ms/azure-cli'
22+
Write-Error 'You must have the Azure CLI installed: https://aka.ms/azure-cli'
2323
exit 1
2424
}
2525

26-
az extension show -n azure-devops > $null
26+
az account show *> $null
27+
if (!$?) {
28+
Write-Host 'Running az login...'
29+
az login *> $null
30+
}
31+
32+
az extension show -n azure-devops *> $null
2733
if (!$?){
2834
Write-Host 'Installing azure-devops extension'
2935
az extension add --name azure-devops

0 commit comments

Comments
 (0)