From a45269d993b703abffda0c476269c27d19998777 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Thu, 17 Nov 2022 00:24:52 +0100 Subject: [PATCH] ci: add commitlint to ci checks for merge requests --- .gitlab-ci.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 712d4fcd..4d5ad90c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,13 @@ # # 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: PACKAGE_NAME: ds4 @@ -17,6 +23,8 @@ stages: - release - publish +image: node:lts + cache: &global_cache paths: - .yarn/cache @@ -61,6 +69,15 @@ reuse: script: - 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: stage: build before_script: