Bitbucket Pipelines question here:
I'm trying to get the commit hash of the head of the destination branch of a PR. I can see the current commit is available in $BITBUCKET_COMMIT and the destination branch name is in $BITBUCKET_PR_DESTINATION_BRANCH, but how can I get the head commit of the destination branch?
I need this to fully take advantage of Happo for UI screenshot testing.
Thanks in advance.
You can use in your bitbucket-pipelines.yml file the following command, in order to get the hash of the last commit in the destination branch:
git rev-parse origin/$BITBUCKET_PR_DESTINATION_BRANCH
Please feel free to let us know if this works for you and if you need anything further!
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events