Skip to content

Commit

Permalink
docs: remove GitLab clone depth limitation (#4105)
Browse files Browse the repository at this point in the history
* docs: remove GitLab clone depth limitation

See #4103

* docs: remove stage config from GitLab

Let's keep the example minimal.
  • Loading branch information
abitrolly committed Jul 26, 2024
1 parent 2eca565 commit a2f27fa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/guides/ci-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,21 @@ 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 +193,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 a2f27fa

Please sign in to comment.