@@ -180,25 +180,23 @@ function Get-dotnet-AdditionalValidationPackagesFromPackageSet {
180180 $pathComponents = $file -split " /"
181181 # handle changes only in sdk/<service>/<file>.<extension>
182182 if ($pathComponents.Length -eq 3 -and $pathComponents [0 ] -eq " sdk" ) {
183- if (-not $changedServices.Contains ($pathComponents [1 ])) {
184- $changedServices += $pathComponents [1 ]
185- }
183+ $changedServices += $pathComponents [1 ]
186184 }
187185
188- # handle any changes under sdk/<file>.<extension>
189- if ( $pathComponents .Length -eq 2 -and $pathComponents [ 0 ] -eq " sdk " ) {
190- if (-not $changedServices .Contains ( " template " )) {
191- $changedServices += " template "
192- }
186+ # handle any changes under sdk/<file>.<extension> or any files
187+ # in the repository root
188+ if (( $pathComponents .Length -eq 2 -and $pathComponents [ 0 ] -eq " sdk " ) -or
189+ ( $pathComponents .Length -eq 1 )) {
190+ $changedServices += " template "
193191 }
194192
195193 # changes to a Azure.*.Shared within a service directory should include all packages within that service directory
196194 if ($file.Replace (' \' , ' /' ) -match " .*sdk/.*/.*\.Shared/.*" ) {
197- if (-not $changedServices.Contains ($pathComponents [1 ])) {
198- $changedServices += $pathComponents [1 ]
199- }
195+ $changedServices += $pathComponents [1 ]
200196 }
201197 }
198+ # dedupe the changedServices list before processing
199+ $changedServices = $changedServices | Get-Unique
202200 foreach ($changedService in $changedServices ) {
203201 $additionalPackages = $AllPkgProps | Where-Object { $_.ServiceDirectory -eq $changedService }
204202
0 commit comments