From 57602c9333224a84dd833dea60404882d86f33dc Mon Sep 17 00:00:00 2001 From: Jan Wennrich <jan.wennrich@pcsg.de> Date: Fri, 20 Jan 2023 18:16:12 +0000 Subject: [PATCH] chore: lint every commit via commitlint --- .gitlab-ci.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 643aafc..8d11590 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,15 +2,20 @@ include: - project: 'quiqqer/semantic-release' file: '/.gitlab-ci.yml' stages: - - validate + - lint - release -validate_merge_request_source_branch: - stage: validate +#validate_merge_request_source_branch: +# stage: validate +# script: +# - echo "Job runs to validate merge request source branch" +# - echo "Testing failed validation" +# - exit 1 +# rules: +# - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" +# - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" +# - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^(\d\.)?\d.x$/ +lint:commit: + stage: lint + image: node:18-slim script: - - echo "Job runs to validate merge request source branch" - - echo "Testing failed validation" - - exit 1 - rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^(\d\.)?\d.x$/ + - echo "${CI_COMMIT_MESSAGE}" | npx commitlint -- GitLab