Commit ee5dad35 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'rf-sast-config-stage-fix' into 'master'

Avoid writing empty stage variable

See merge request gitlab-org/gitlab!38631
parents a0adf4a2 66416af8
......@@ -36,7 +36,7 @@ module Security
end
def sast_stage
@params['stage'] || 'test'
@params['stage'].presence ? @params['stage'] : 'test'
end
# We only want to write variables that are set
......
......@@ -6,8 +6,12 @@ RSpec.describe Security::CiConfiguration::SastBuildActions do
context 'autodevops disabled' do
let(:auto_devops_enabled) { false }
context 'with one empty parameter' do
let(:params) { { 'SECURE_ANALYZERS_PREFIX' => '' } }
context 'with empty parameters' do
let(:params) do
{ 'stage' => '',
'SECURE_ANALYZERS_PREFIX' => '',
'SEARCH_MAX_DEPTH' => '' }
end
subject(:result) { described_class.new(auto_devops_enabled, params).generate }
......
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