From adc2e47bcfcd416361aa1381d54fee87153dbc6e Mon Sep 17 00:00:00 2001 From: Grant Forsythe <23422098+grantwforsythe@users.noreply.github.com> Date: Wed, 11 Sep 2024 22:17:22 -0400 Subject: [PATCH] docs: add bitbucket to ci-setup guide (#4147) --- docs/guides/ci-setup.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/guides/ci-setup.md b/docs/guides/ci-setup.md index 3f863baef3..c84fd1af43 100644 --- a/docs/guides/ci-setup.md +++ b/docs/guides/ci-setup.md @@ -178,6 +178,25 @@ spec: timeout: 15m ``` +## BitBucket + +Validate commits within a PR by leveraging [BitBucket`s default variables](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/): + +```yml +image: node:18 + +pipelines: + pull-requests: + default: + - step: + name: Lint commit messages + script: + - npm install --save-dev @commitlint/config-conventional @commitlint/cli + - npx commitlint --from $BITBUCKET_COMMIT~$(git rev-list --count $BITBUCKET_BRANCH ^origin/$BITBUCKET_PR_DESTINATION_BRANCH) --to $BITBUCKET_COMMIT --verbose +``` + +BitBucket limits git clone depth to 20 commits by default. You can change this behaviour by [changing the `clone` option](https://support.atlassian.com/bitbucket-cloud/docs/git-clone-behavior/). + ### 3rd party integrations #### [Codemagic](https://codemagic.io/)