ci: add commitlint to ci checks for merge requests

This commit is contained in:
Johannes Loher 2022-11-17 00:24:52 +01:00
parent cf92096102
commit a45269d993

View file

@ -3,7 +3,13 @@
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
image: node:lts workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
- if: $CI_COMMIT_TAG
variables: variables:
PACKAGE_NAME: ds4 PACKAGE_NAME: ds4
@ -17,6 +23,8 @@ stages:
- release - release
- publish - publish
image: node:lts
cache: &global_cache cache: &global_cache
paths: paths:
- .yarn/cache - .yarn/cache
@ -61,6 +69,15 @@ reuse:
script: script:
- reuse lint - reuse lint
commitlint:
stage: check
before_script:
- yarn install --immutable
script:
- yarn run commitlint --from $CI_MERGE_REQUEST_DIFF_BASE_SHA
rules:
- if: "$CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_DIFF_BASE_SHA"
build: build:
stage: build stage: build
before_script: before_script: