I am working to create a job in a stage that determines if a particular git commit has any file changes in a specific directory. If so I want to run another job.
I tried below in a bash task:
- task: Bash@3
inputs:
targetType: 'inline'
awsCredentials: ${{ parameters.awsCredentials }}
workingDirectory: envs/${{ parameters.environment }}
script: |
commitid=
git rev-parse --short=7 HEAD
changes=git diff-tree --no-commit-id --name-only -r $commitid| grep $(basename $PWD)
Above changes is working on my workstation, but it is not returning any when i echo $commitid in the pipeline task.