I would like to control what happens in bitbucket pipelines based on which files have changed when a pull request is approved and merged into destination branch. The problem I am running into is that bitbucket commits prior to running the pipeline. So when the pipeline is kicked off, all commits are on the current branch. So I don't understand how can I know which files have changes since the last time a pipeline was run?
I don't think git show HEAD^1
would work because there might be dozens of commits. I don't know how to do git diff between the latest commit PRIOR to merging the pull request vs latest commit that was just merged as part of the pull request.
Is there a way to know which files are changing as part of the pull request using git commands? Essentially, same information that Bitbucket shows you when you are reviewing a pull request, how can I get that list of files?