From d0fd2be79949080ccd5aeb8c6c2184811760ca5f Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Thu, 15 Sep 2022 10:39:06 +0200 Subject: [PATCH] Only run lint jobs for MRs --- .gitlab-ci.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 820fecbf0..12024f6d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -127,9 +127,10 @@ black: - pip install black script: - black --check --diff . - only: - changes: - - api/**/* + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: + - api/**/* flake8: interruptible: true @@ -145,9 +146,10 @@ flake8: key: "$CI_PROJECT_ID__flake8_pip_cache" paths: - "$PIP_CACHE_DIR" - only: - changes: - - api/**/* + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: + - api/**/* eslint: interruptible: true @@ -164,9 +166,10 @@ eslint: key: "$CI_PROJECT_ID__eslint_npm_cache" paths: - front/node_modules - only: - changes: - - front/**/* + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: + - front/**/* test_api: interruptible: true