Skip to content

Commit

Permalink
docs: remove GitLab clone depth limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
abitrolly authored Jul 26, 2024
1 parent 2eca565 commit 1bbe5cd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/guides/ci-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,22 @@ 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
script:
- 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
Expand Down Expand Up @@ -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).

0 comments on commit 1bbe5cd

Please sign in to comment.