diff options
author | feistel <6742251-feistel@users.noreply.gitlab.com> | 2022-06-11 20:35:31 +0300 |
---|---|---|
committer | feistel <6742251-feistel@users.noreply.gitlab.com> | 2022-06-11 20:35:31 +0300 |
commit | 088196125ab6e78f9dd59fa570cace4d44b5dc74 (patch) | |
tree | 37a802a79bc242dc94d69bb1d04011da17007ecb /.gitlab/ci | |
parent | 413d38fbd39fc3870ee5668ce69ee50d952deb73 (diff) |
Run dependency and license scanner on MRs only if go.mod changed
Diffstat (limited to '.gitlab/ci')
-rw-r--r-- | .gitlab/ci/prepare.yml | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/.gitlab/ci/prepare.yml b/.gitlab/ci/prepare.yml index c9099115..f2da6a9e 100644 --- a/.gitlab/ci/prepare.yml +++ b/.gitlab/ci/prepare.yml @@ -24,11 +24,27 @@ variables: - if: '$CI_COMMIT_BRANCH =~ /^[\d-]+-stable(-ee)?$/' - if: '$CI_COMMIT_BRANCH =~ /^security\//' +.rules-for-dependency-scanners: &rules-for-dependency-scanners + stage: prepare + needs: [] + rules: + # For merge requests, create a pipeline. + - if: '$CI_MERGE_REQUEST_IID' + changes: + - go.mod + # For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.). + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + # For tags, create a pipeline. + - if: '$CI_COMMIT_TAG' + # For stable, and security branches, create a pipeline. + - if: '$CI_COMMIT_BRANCH =~ /^[\d-]+-stable(-ee)?$/' + - if: '$CI_COMMIT_BRANCH =~ /^security\//' + license_scanning: - <<: *rules-for-scanners + <<: *rules-for-dependency-scanners gemnasium-dependency_scanning: - <<: *rules-for-scanners + <<: *rules-for-dependency-scanners gosec-sast: <<: *rules-for-scanners |