diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2022-07-05 18:44:43 +0300 |
---|---|---|
committer | Vladimir Shushlin <vshushlin@gitlab.com> | 2022-07-05 18:44:43 +0300 |
commit | f04653d860c8ea8a204557fc2bb7a2b48b9f2fc5 (patch) | |
tree | 48a9d8f99ce2725a3fca966b28aa806ad4df8bab /.gitlab | |
parent | e5c6fb48bfa08c6ebc6034909781007190bde6ec (diff) | |
parent | 088196125ab6e78f9dd59fa570cace4d44b5dc74 (diff) |
Merge branch 'ci/mr-lazy-dependency-scanner' into 'master'
ci: run dependency and license scanner on MRs only if go.mod changed
See merge request gitlab-org/gitlab-pages!783
Diffstat (limited to '.gitlab')
-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 4770c128..692e7920 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 semgrep-sast: <<: *rules-for-scanners |