diff --git a/eng/common/pipelines/templates/steps/save-package-properties.yml b/eng/common/pipelines/templates/steps/save-package-properties.yml index 17fe7dec1bb8..5ac89da9cdee 100644 --- a/eng/common/pipelines/templates/steps/save-package-properties.yml +++ b/eng/common/pipelines/templates/steps/save-package-properties.yml @@ -34,7 +34,7 @@ steps: ${{ parameters.ScriptDirectory }}/Generate-PR-Diff.ps1 -TargetPath '${{ parameters.TargetPath }}' -ArtifactPath '${{ parameters.DiffDirectory }}' - -ExcludePaths ('${{ convertToJson(parameters.ExcludePaths) }}' | convertFrom-Json) + -ExcludePaths ('${{ convertToJson(parameters.ExcludePaths) }}' | ConvertFrom-Json) pwsh: true # When running in PR mode, we want the detected changed services to be attached to the build as tags. diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index 74abb0ce3bf3..bc7b5738e2d3 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -167,8 +167,9 @@ function Get-PrPkgProperties([string]$InputDiffJson) { # 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. - $excludePaths = $diff.ExcludePaths | ForEach-Object { $_ + "/" } + # 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("/") + "/" } $additionalValidationPackages = @() $lookup = @{}