Skip to content

Commit

Permalink
Handle missing artifacts without exception (#31437)
Browse files Browse the repository at this point in the history
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#9179 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

Co-authored-by: Scott Beddall <[email protected]>
  • Loading branch information
azure-sdk and scbedd authored Oct 16, 2024
1 parent d0b70a8 commit 97e9849
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eng/common/scripts/Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ class PackageProps
$content = Get-Content -Raw -Path $ymlPath | CompatibleConvertFrom-Yaml
if ($content) {
$artifacts = $this.GetValueSafely($content, @("extends", "parameters", "Artifacts"))
$artifactForCurrentPackage = $null

$artifactForCurrentPackage = $artifacts | Where-Object { $_["name"] -eq $this.ArtifactName -or $_["name"] -eq $this.Name }
if ($artifacts) {
$artifactForCurrentPackage = $artifacts | Where-Object { $_["name"] -eq $this.ArtifactName -or $_["name"] -eq $this.Name }
}

if ($artifactForCurrentPackage) {
return [HashTable]$artifactForCurrentPackage
Expand Down

0 comments on commit 97e9849

Please sign in to comment.