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

doc: add gitlabci example #4

Merged
merged 1 commit into from
Nov 11, 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
doc: add gitlabci example
rwaffen authored Nov 11, 2024
commit d2c87951a42d1737d35c506623ff00669ec40015
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -68,3 +68,25 @@ rules:
- always
- [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]
```
### Example GitLab CI Job
```yaml
commitlint:
stage: .pre # Default Stage of gitlab-ci. Runs before every other pipeline
image:
name: ghcr.io/voxpupuli/commitlint:latest
entrypoint: [""] # overwrite entrypoint
interruptible: true
variables:
# Checkout entire repo and use clone
GIT_DEPTH: 0
GIT_STRATEGY: clone
script:
# switch to MR branch instead of detached HEAD
- git switch $CI_COMMIT_REF_NAME
- commitlint --from $(git merge-base origin/$CI_DEFAULT_BRANCH HEAD) --to HEAD
rules:
# only run on merge request pipelines
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
```