handle only deleted files in a <language> - pullrequest build (#6359)
Co-authored-by: Scott Beddall <scbedd@microsoft.com>
This commit is contained in:
parent
4d8c32d22a
commit
12d9e66e4f
@ -48,6 +48,7 @@ $changedFiles = @()
|
||||
$changedServices = @()
|
||||
|
||||
$changedFiles = Get-ChangedFiles -DiffPath $TargetPath
|
||||
$deletedFiles = Get-ChangedFiles -DiffPath $TargetPath -DiffFilterType "D"
|
||||
|
||||
if ($changedFiles) {
|
||||
$changedServices = Get-ChangedServices -ChangedFiles $changedFiles
|
||||
@ -63,6 +64,7 @@ $result = [PSCustomObject]@{
|
||||
"ChangedFiles" = $changedFiles
|
||||
"ChangedServices" = $changedServices
|
||||
"ExcludePaths" = $ExcludePaths
|
||||
"DeletedFiles" = $deletedFiles
|
||||
"PRNumber" = if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER } else { "-1" }
|
||||
}
|
||||
|
||||
|
||||
@ -162,6 +162,14 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
|
||||
$allPackageProperties = Get-AllPkgProperties
|
||||
$diff = Get-Content $InputDiffJson | ConvertFrom-Json
|
||||
$targetedFiles = $diff.ChangedFiles
|
||||
|
||||
if ($diff.DeletedFiles) {
|
||||
if (-not $targetedFiles) {
|
||||
$targetedFiles = @()
|
||||
}
|
||||
$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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user