diff --git a/.azure-pipelines/util/get-pr-changed-files.yml b/.azure-pipelines/util/get-pr-changed-files.yml index bf02261446d0..c9a050966148 100644 --- a/.azure-pipelines/util/get-pr-changed-files.yml +++ b/.azure-pipelines/util/get-pr-changed-files.yml @@ -7,13 +7,13 @@ steps: script: | # refer to https://learn.microsoft.com/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#system-variables-devops-services # get the target branch name - $targetBranch = $(System.PullRequest.TargetBranch) + $targetBranch = "$(System.PullRequest.TargetBranch)" # fetch the targetBranch from origin to local branch and rename the branch to 'origin/base' git fetch --no-tags origin "${targetBranch}:origin/base" # refer to https://git-scm.com/docs/git-diff # compare the pr and targetBranch branch, get the changed file list - # diff-filter options are ACMRT, which are: Added, Copied, Modified, Renamed , Changed - $changedFiles = git --no-pager diff --name-only --diff-filter=ACMRT origin/base -- . + # diff-filter options are ACDMRT, which are: Added, Copied, Deleted, Modified, Renamed, Changed + $changedFiles = git --no-pager diff --name-only --diff-filter=ACDMRT origin/base -- . Write-Host "Total updated files:" $changedFiles.Count Write-Host "All Updated files:" $changedFiles | Foreach-Object {Write-Host $_}