Commit 90411266 authored by Marcel Amirault's avatar Marcel Amirault Committed by Robert Speicher

Allow MR pipelines in latest DAST template

parent 50022004
......@@ -84,6 +84,31 @@ RSpec.describe 'DAST.latest.gitlab-ci.yml' do
context 'when no specification provided' do
include_examples 'includes dast job'
end
context 'when pipeline is a merge request pipeline' do
before do
create(:ci_variable, project: project, key: 'CI_MERGE_REQUEST_IID', value: '1')
end
include_examples 'includes dast job'
end
context 'when pipeline is a branch pipeline with no merge request' do
before do
create(:ci_variable, project: project, key: 'CI_COMMIT_BRANCH', value: 'feature-branch')
end
include_examples 'includes dast job'
end
context 'when pipeline is a branch pipeline with a merge request' do
before do
create(:ci_variable, project: project, key: 'CI_COMMIT_BRANCH', value: 'feature-branch')
create(:ci_variable, project: project, key: 'CI_OPEN_MERGE_REQUESTS', value: 'true')
end
include_examples 'includes no jobs'
end
end
end
......
......@@ -47,10 +47,13 @@ dast:
$REVIEW_DISABLED && $DAST_WEBSITE == null &&
$DAST_API_SPECIFICATION == null
when: never
- if: $CI_COMMIT_BRANCH &&
- if: $CI_MERGE_REQUEST_IID &&
$CI_KUBERNETES_ACTIVE &&
$GITLAB_FEATURES =~ /\bdast\b/
- if: $CI_MERGE_REQUEST_IID && ($DAST_WEBSITE || $DAST_API_SPECIFICATION)
- if: $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH &&
$DAST_WEBSITE
- if: $CI_COMMIT_BRANCH &&
$DAST_API_SPECIFICATION
$CI_KUBERNETES_ACTIVE &&
$GITLAB_FEATURES =~ /\bdast\b/
- if: $CI_COMMIT_BRANCH && ($DAST_WEBSITE || $DAST_API_SPECIFICATION)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment