Allow eng/ based packages to parse ci.yml (#6514)

Co-authored-by: Scott Beddall <scbedd@microsoft.com>
This commit is contained in:
Azure SDK Bot 2025-04-08 10:16:38 -07:00 committed by GitHub
parent c49375b9d4
commit 65c7ba53c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -115,11 +115,28 @@ class PackageProps {
return $null
}
[PSCustomObject]GetCIYmlForArtifact() {
[System.IO.FileInfo[]]ResolveCIFolderPath() {
$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)
$ciFiles = @()
# if this path exists, then we should look in it for the ci.yml files and return nothing if nothing is found
if (Test-Path $ciFolderPath){
$ciFiles = @(Get-ChildItem -Path $ciFolderPath -Filter "ci*.yml" -File)
}
# if not, we should at least try to resolve the eng/ folder to fall back and see if that's where the path exists
else {
$ciFolderPath = Join-Path -Path $RepoRoot -ChildPath (Join-Path "eng" $this.ServiceDirectory)
if (Test-Path $ciFolderPath) {
$ciFiles = @(Get-ChildItem -Path $ciFolderPath -Filter "ci*.yml" -File)
}
}
return $ciFiles
}
[PSCustomObject]GetCIYmlForArtifact() {
$ciFiles = @($this.ResolveCIFolderPath())
$ciArtifactResult = $null
$soleCIYml = ($ciFiles.Count -eq 1)