From c6d892cfb5695052e1ed4ae824b3ac1990192010 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Tue, 5 Nov 2024 10:44:05 -0800 Subject: [PATCH] feedback from Ben --- eng/common/scripts/Package-Properties.ps1 | 34 ++++++++++++----------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index e417536041..22b109ca6e 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -106,22 +106,24 @@ class PackageProps { } [void]InitializeCIArtifacts() { - if ($env:TF_BUILD -or $env:GITHUB_ACTIONS) { - $RepoRoot = Resolve-Path (Join-Path $PSScriptRoot ".." ".." "..") - - $ciFolderPath = Join-Path -Path $RepoRoot -ChildPath (Join-Path "sdk" $this.ServiceDirectory) - $ciFiles = Get-ChildItem -Path $ciFolderPath -Filter "ci*.yml" -File - - if (-not $this.ArtifactDetails) { - foreach ($ciFile in $ciFiles) { - $ciArtifactResult = $this.ParseYmlForArtifact($ciFile.FullName) - if ($ciArtifactResult) { - $this.ArtifactDetails = [Hashtable]$ciArtifactResult.ArtifactConfig - $this.CIMatrixConfigs = $ciArtifactResult.MatrixConfigs - # if this package appeared in this ci file, then we should - # treat this CI file as the source of the Matrix for this package - break - } + if ($env:SYSTEM_TEAMPROJECTID -or $env:GITHUB_ACTIONS) { + return + } + + $RepoRoot = Resolve-Path (Join-Path $PSScriptRoot ".." ".." "..") + + $ciFolderPath = Join-Path -Path $RepoRoot -ChildPath (Join-Path "sdk" $this.ServiceDirectory) + $ciFiles = Get-ChildItem -Path $ciFolderPath -Filter "ci*.yml" -File + + if (-not $this.ArtifactDetails) { + foreach ($ciFile in $ciFiles) { + $ciArtifactResult = $this.ParseYmlForArtifact($ciFile.FullName) + if ($ciArtifactResult) { + $this.ArtifactDetails = [Hashtable]$ciArtifactResult.ArtifactConfig + $this.CIMatrixConfigs = $ciArtifactResult.MatrixConfigs + # if this package appeared in this ci file, then we should + # treat this CI file as the source of the Matrix for this package + break } } }