From 1bbe5cd18353dcd67936e3d6aaf0722ef472cf5c Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Fri, 26 Jul 2024 11:50:54 +0300 Subject: [PATCH] docs: remove GitLab clone depth limitation See https://github.com/conventional-changelog/commitlint/issues/4103 --- docs/guides/ci-setup.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/guides/ci-setup.md b/docs/guides/ci-setup.md index 7d11bfb148..129d4f8725 100644 --- a/docs/guides/ci-setup.md +++ b/docs/guides/ci-setup.md @@ -125,10 +125,11 @@ workflows: ## GitLab CI ```yaml -stages: ['lint', 'build', 'test'] lint:commit: image: registry.hub.docker.com/library/node:alpine stage: lint + variables: + GIT_DEPTH: 0 before_script: - apk add --no-cache git - npm install --save-dev @commitlint/config-conventional @commitlint/cli @@ -136,6 +137,10 @@ lint:commit: - echo "${CI_COMMIT_MESSAGE}" | npx commitlint ``` +GitLab limits `git clone` depth to +[20 commits by default](https://docs.gitlab.com/ee/ci/pipelines/settings.html#limit-the-number-of-changes-fetched-during-clone). +Setting `GIT_DEPTH: 0` removes this limitation, so `commitlint` can check larger MRs. + ## GitLab CI with pre-build container ```yaml @@ -189,4 +194,4 @@ workflows: > [!TIP] > Help yourself adopting a commit convention by using an interactive commit prompt. -> Learn how to use `@commitlint/prompt-cli` in the [Use prompt guide](/> guides/use-prompt) +> Learn how to use `@commitlint/prompt-cli` in the [Use prompt guide](/guides/use-prompt).