Hi
I'm trying to get the changed folders in bitbucket pipeline, but I'm not able to do that.
I'm using the command
git fetch origin $BITBUCKET_PR_DESTINATION_BRANCH
git diff --name-only --diff-filter=d $BITBUCKET_COMMIT
When I put hardcoded commit it is working fine ie.e
git fetch origin $BITBUCKET_PR_DESTINATION_BRANCH
git diff --name-only --diff-filter=d abwjdsefd
I'm trying to store the output in some other variable.
Script
- git diff --name-only --diff-filter=d <hard_coded_commit> > changed_1.txt
- eval cat changed_1.txt
- git diff --name-only --diff-filter=d $BITBUCKET_COMMIT > changed.txt
- eval cat changed.txt
changed_1.txt is outputting correct values, whereas changed.txt is giving nothing.
My use case is to run the pipeline for PR for changed folders and when PR is merged, I want to process those folders again with branches in pipeline.