Avoid adding the same package twice, use TrimStart instead of substring (#5956)
Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>
This commit is contained in:
parent
e636fc5f3e
commit
14e5fcd057
@ -119,7 +119,7 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
|
||||
foreach ($pkg in $allPackageProperties)
|
||||
{
|
||||
$pkgDirectory = Resolve-Path "$($pkg.DirectoryPath)"
|
||||
$lookupKey = ($pkg.DirectoryPath).Replace($RepoRoot, "").SubString(1)
|
||||
$lookupKey = ($pkg.DirectoryPath).Replace($RepoRoot, "").TrimStart('\/')
|
||||
$lookup[$lookupKey] = $pkg
|
||||
|
||||
foreach ($file in $targetedFiles)
|
||||
@ -132,12 +132,15 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
|
||||
if ($pkg.AdditionalValidationPackages) {
|
||||
$additionalValidationPackages += $pkg.AdditionalValidationPackages
|
||||
}
|
||||
|
||||
# avoid adding the same package multiple times
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($addition in $additionalValidationPackages) {
|
||||
$key = $addition.Replace($RepoRoot, "").SubString(1)
|
||||
$key = $addition.Replace($RepoRoot, "").TrimStart('\/')
|
||||
|
||||
if ($lookup[$key]) {
|
||||
$packagesWithChanges += $lookup[$key]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user