Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: remove GitLab clone depth limitation #4105

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).