From 464d698f2a4503a2396099cbd2183e4796217bd3 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Wed, 20 Mar 2024 11:43:00 -0400 Subject: [PATCH] Set erroractionpreference for change log check --- eng/common/scripts/ChangeLog-Operations.ps1 | 4 ++++ eng/common/scripts/Validate-All-Packages.ps1 | 1 + eng/common/scripts/Validate-Package.ps1 | 1 + 3 files changed, 6 insertions(+) diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index 075d95017519..fb5f85c9a49f 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -148,6 +148,10 @@ function Confirm-ChangeLogEntry { Message = "" } } + else { + # Do not stop the script on error when status object is passed as param + $ErrorActionPreference = 'Continue' + } $changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $ChangeLogLocation $changeLogEntry = $changeLogEntries[$VersionString] diff --git a/eng/common/scripts/Validate-All-Packages.ps1 b/eng/common/scripts/Validate-All-Packages.ps1 index 03bb30cf3acc..46d76195ba14 100644 --- a/eng/common/scripts/Validate-All-Packages.ps1 +++ b/eng/common/scripts/Validate-All-Packages.ps1 @@ -37,6 +37,7 @@ function ProcessPackage($PackageName, $ConfigFileDir) -Devops_pat $Devops_pat if ($LASTEXITCODE -ne 0) { Write-Error "Failed to validate package $PackageName" + exit 1 } } diff --git a/eng/common/scripts/Validate-Package.ps1 b/eng/common/scripts/Validate-Package.ps1 index 05746fd977db..57f093d76e69 100644 --- a/eng/common/scripts/Validate-Package.ps1 +++ b/eng/common/scripts/Validate-Package.ps1 @@ -247,5 +247,6 @@ if ($IsReleaseBuild) { if (!$updatedWi -or $changelogStatus.Status -ne "Success" -or $apireviewDetails.ApiviewApproval.Status -ne "Approved" -or $apireviewDetails.PackageNameApproval.Status -ne "Approved") { Write-Error "At least one of the Validations above failed for package $PackageName with version $versionString." + exit 1 } } \ No newline at end of file