summaryrefslogtreecommitdiff
path: root/lib/security
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-08 21:55:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-08 21:55:36 +0000
commitb2066dcc69e0f4ea603ac43367c2b25e596dd671 (patch)
treefe4e10bc1feda7d74589c507ab43288a98b5cd6f /lib/security
parent94cb5cf7da670f11b320741a1c1c8605abcb86d7 (diff)
downloadgitlab-ce-b2066dcc69e0f4ea603ac43367c2b25e596dd671.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/security')
-rw-r--r--lib/security/ci_configuration/base_build_action.rb5
-rw-r--r--lib/security/ci_configuration/sast_build_action.rb4
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/security/ci_configuration/base_build_action.rb b/lib/security/ci_configuration/base_build_action.rb
index 6012067fb53..9c2670144e3 100644
--- a/lib/security/ci_configuration/base_build_action.rb
+++ b/lib/security/ci_configuration/base_build_action.rb
@@ -3,9 +3,10 @@
module Security
module CiConfiguration
class BaseBuildAction
- def initialize(auto_devops_enabled, existing_gitlab_ci_content)
+ def initialize(auto_devops_enabled, existing_gitlab_ci_content, ci_config_path = ::Ci::Pipeline::DEFAULT_CONFIG_PATH)
@auto_devops_enabled = auto_devops_enabled
@existing_gitlab_ci_content = existing_gitlab_ci_content || {}
+ @ci_config_path = ci_config_path || ::Ci::Pipeline::DEFAULT_CONFIG_PATH
end
def generate
@@ -13,7 +14,7 @@ module Security
update_existing_content!
- { action: action, file_path: '.gitlab-ci.yml', content: prepare_existing_content, default_values_overwritten: @default_values_overwritten }
+ { action: action, file_path: @ci_config_path, content: prepare_existing_content, default_values_overwritten: @default_values_overwritten }
end
private
diff --git a/lib/security/ci_configuration/sast_build_action.rb b/lib/security/ci_configuration/sast_build_action.rb
index 3fa5e9c7177..63f16a1bebe 100644
--- a/lib/security/ci_configuration/sast_build_action.rb
+++ b/lib/security/ci_configuration/sast_build_action.rb
@@ -3,8 +3,8 @@
module Security
module CiConfiguration
class SastBuildAction < BaseBuildAction
- def initialize(auto_devops_enabled, params, existing_gitlab_ci_content)
- super(auto_devops_enabled, existing_gitlab_ci_content)
+ def initialize(auto_devops_enabled, params, existing_gitlab_ci_content, ci_config_path = ::Ci::Pipeline::DEFAULT_CONFIG_PATH)
+ super(auto_devops_enabled, existing_gitlab_ci_content, ci_config_path)
@variables = variables(params)
@default_sast_values = default_sast_values(params)
@default_values_overwritten = false