I have the following pipeline set up for pull requests:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
depth: 1 # this doesnt work for some reason...
- pipe: sonarsource/sonarcloud-scan:1.2.0
- step: *build-test-sonarcloud
The clone depth works fine for the custom/branch pipelines but not for the pull-request pipeline.
Ive tried setting clone enabled to false and that seems to apply fine so not sure why clone depth isnt being picked up.
Pull Request pipelines use special checkout rules, as noted in the docs https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/
PR builds checkout the current branch and merge in the target branch. It is intended to mimic the state post-merge of complete branch histories.
Shallow clones sever the history prior to the number of commits specified. Fine if you don't need the commit history, but of course git needs that history back to the point of divergence in order to merge correctly. So shallow clone would then fail merge or worse have a different outcome than an actual merge to master later with full repos.
We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...
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