Sync eng/common directory with azure-sdk-tools for PR 9896 (#6430)

* Remove trailing slash addition to ExcludePaths

* Remove the needless loop and, now defunct, comment

---------

Co-authored-by: James Suplizio <jasupliz@microsoft.com>
This commit is contained in:
Azure SDK Bot 2025-02-21 12:13:50 -08:00 committed by GitHub
parent 429f81b88f
commit 4eb517add9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -185,14 +185,7 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
$targetedFiles += $diff.DeletedFiles
}
# The exclude paths and the targeted files paths aren't full OS paths, they're
# GitHub paths meaning they're relative to the repo root and slashes are forward
# slashes "/". The ExcludePaths need to have a trailing slash added in order
# correctly test for string matches without overmatching. For example, if a pr
# had files sdk/foo/file1 and sdk/foobar/file2 with the exclude of anything in
# sdk/foo, it should only exclude things under sdk/foo. The TrimEnd is just in
# case one of the paths ends with a slash, it doesn't add a second one.
$excludePaths = $diff.ExcludePaths | ForEach-Object { $_.TrimEnd("/") + "/" }
$excludePaths = $diff.ExcludePaths
$additionalValidationPackages = @()
$lookup = @{}