From 30931618ccbbbfb2a282f90b261c47f821f4279e Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Sun, 5 May 2024 13:39:22 -0500 Subject: [PATCH] update rules --- pipeline.yml | 1 - pipelines/compliance.yml | 2 +- pipelines/go-build.yml | 2 +- rules/mr-rules.yml | 3 --- rules/rules.yml | 10 +++++++++- 5 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 rules/mr-rules.yml diff --git a/pipeline.yml b/pipeline.yml index ce019ef..b141189 100644 --- a/pipeline.yml +++ b/pipeline.yml @@ -17,4 +17,3 @@ include: - 'pipelines/linter.yml' - 'pipelines/security.yml' - 'rules/rules.yml' - - 'rules/mr-rules.yml' diff --git a/pipelines/compliance.yml b/pipelines/compliance.yml index a648db7..44b81fd 100644 --- a/pipelines/compliance.yml +++ b/pipelines/compliance.yml @@ -19,7 +19,7 @@ version: secret_detection: stage: validate rules: - - if: $CI_MERGE_REQUEST_IID + - !reference [.mr_only_rules, rules] allow_failure: false sonarqube: diff --git a/pipelines/go-build.yml b/pipelines/go-build.yml index 03b3a6b..f7b58ca 100644 --- a/pipelines/go-build.yml +++ b/pipelines/go-build.yml @@ -14,7 +14,7 @@ gobuild: extends: .golang-build stage: build rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' || $CI_MERGE_REQUEST_IID + - !reference [.default_mr_rules, rules] exists: - "go.mod" diff --git a/rules/mr-rules.yml b/rules/mr-rules.yml deleted file mode 100644 index b13bd2f..0000000 --- a/rules/mr-rules.yml +++ /dev/null @@ -1,3 +0,0 @@ -.default_mr_rules: - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' || $CI_MERGE_REQUEST_IID diff --git a/rules/rules.yml b/rules/rules.yml index 73c7fde..3efb6fd 100644 --- a/rules/rules.yml +++ b/rules/rules.yml @@ -4,6 +4,14 @@ .sonarqube_rules: rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' || $CI_MERGE_REQUEST_IID exists: - "sonar-project.properties" + +.default_mr_rules: + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' || $CI_MERGE_REQUEST_IID + +.mr_only_rules: + rules: + - if: $CI_MERGE_REQUEST_IID