Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .azure-pipelines/util/get-pr-changed-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 $_}
Expand Down