I am using ant migration tool in bitbucket pipelines to deploy metadata into Salesforce instance. This pipeline runs for every commit pushed to master branch. The build process takes a considerable amount of time since it always deploy the whole set of files.
As a work around my plan is to find only the set of files which are changed since last successful build. Then generate the package.xml file accordingly. To evaluate the difference I need to know the commit hash of last successful build.
Does anyone know how to get the commit hash of last successful build in bitbucket pipelines?