I am trying to get all the committed files on an Azure Build Pipeline. This is the yaml script I'm using:
trigger:
branches:
include:
- swagger_dev
paths:
include:
- swagger_dev/swaggers/*.yaml
variables:
CLIENT_CREDENTIALS: $(ClientCredentials)
steps:
- powershell: |
echo "$(Build.SourceVersion)"
echo "$(git diff-tree --no-commit-id --diff-filter=d --name-only -r $(Build.SourceVersion))"
When I commit one or more files, the Pipeline correctly echoes the Build.SourceVersion but then echoes an empty output for the git command: pipeline log
How is that possible? I am currently on a branch called swagger_dev and the committed files are in the directory swagger_dev/swaggers. Maybe I should add those informations to the diff-tree command?