Skip to content

Commit 3afcf36

Browse files
raych1azure-sdk
authored andcommitted
Reduced duplicated parsing
1 parent 182f146 commit 3afcf36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eng/common/scripts/SetTestPipelineVersion.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Write-Host "BuildID: $BuildID"
2121
Write-Host "ArtifactsJson: $ArtifactsJson"
2222

2323
$packageNamesArray = @()
24+
$artifacts = $null
2425

2526
# If ArtifactsJson is provided, extract package names from it
2627
if (![String]::IsNullOrWhiteSpace($ArtifactsJson)) {
@@ -43,10 +44,9 @@ else {
4344
exit 1
4445
}
4546

46-
if (![String]::IsNullOrWhiteSpace($ArtifactsJson)) {
47+
if ($artifacts) {
4748
# When using ArtifactsJson, process each artifact with its name and groupId (if applicable)
4849
try {
49-
$artifacts = $ArtifactsJson | ConvertFrom-Json
5050
foreach ($artifact in $artifacts) {
5151
$packageName = $artifact.name
5252
$newVersion = [AzureEngSemanticVersion]::new("1.0.0")

0 commit comments

Comments
 (0)