Skip to content
代码片段 群组 项目
未验证 提交 33d63e3e 编辑于 作者: Sashi Kumar Kumaresan's avatar Sashi Kumar Kumaresan 提交者: GitLab
浏览文件

Merge branch '434321-fix-scan-execution-policy-does-not-trigger-without-ci-file' into 'master'

No related branches found
No related tags found
无相关合并请求
...@@ -26,6 +26,8 @@ def perform ...@@ -26,6 +26,8 @@ def perform
return @config if valid_security_orchestration_policy_configurations.blank? return @config if valid_security_orchestration_policy_configurations.blank?
return @config unless extend_configuration? return @config unless extend_configuration?
@config[:workflow] = { rules: [{ when: 'always' }] } if @config.empty?
merged_config = @config.deep_merge(merged_security_policy_config) merged_config = @config.deep_merge(merged_security_policy_config)
if custom_scan_actions_enabled? && active_scan_custom_actions.any? if custom_scan_actions_enabled? && active_scan_custom_actions.any?
......
...@@ -186,6 +186,14 @@ ...@@ -186,6 +186,14 @@
context 'when policy is applicable on branch from the pipeline' do context 'when policy is applicable on branch from the pipeline' do
let(:ref) { 'refs/heads/master' } let(:ref) { 'refs/heads/master' }
context 'and the project does not have a CI configuration' do
let_it_be(:config) { {} }
it 'adds a workflow rule' do
expect(subject).to include({ workflow: { rules: [when: 'always'] } })
end
end
context 'when DAST profiles are not found' do context 'when DAST profiles are not found' do
it 'does not modify the config' do it 'does not modify the config' do
expect(subject[:'dast-on-demand-0']).to eq({ allow_failure: true, script: 'echo "Error during On-Demand Scan execution: Dast site profile was not provided" && false' }) expect(subject[:'dast-on-demand-0']).to eq({ allow_failure: true, script: 'echo "Error during On-Demand Scan execution: Dast site profile was not provided" && false' })
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册