Skip to content

Commit

Permalink
Merge pull request #4 from voxpupuli/gitlab_example
Browse files Browse the repository at this point in the history
doc: add gitlabci example
  • Loading branch information
rwaffen authored Nov 11, 2024
2 parents 88df7fe + d2c8795 commit 846562e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
```

0 comments on commit 846562e

Please sign in to comment.