We are using Bitbucket Pipelines for our CI/CD solution.
- We use two triggers on-pull-request and on-master-branch.
- On-pull-request created/updated trigger we deploy a new infrastructure with a prefix of a branch name and then we execute tests.
- When that pull request is merged to a master branch, the other on-master-branch trigger is triggered which should cleanup/destroy previously deployed infrastructure and create a build and push that build to a repository.
The problem is the second master-branch triggered pipeline does not know what branch was merged to master. Is there any way to know this in bitbucket pipelines? We need to know this so we could back-trace a previously deployed infrastructure run tests once more and then destroy it.
Thank you!