debian-mirror-gitlab/app/services/security/ci_configuration/sast_create_service.rb

33 lines
943 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
module Security
module CiConfiguration
2021-06-08 01:23:25 +05:30
class SastCreateService < ::Security::CiConfiguration::BaseCreateService
attr_reader :params
2021-03-11 19:13:27 +05:30
def initialize(project, current_user, params)
2021-06-08 01:23:25 +05:30
super(project, current_user)
2021-03-11 19:13:27 +05:30
@params = params
end
private
2021-06-08 01:23:25 +05:30
def action
Security::CiConfiguration::SastBuildAction.new(project.auto_devops_enabled?, params, existing_gitlab_ci_content).generate
2021-03-11 19:13:27 +05:30
end
2021-06-08 01:23:25 +05:30
def next_branch
'set-sast-config'
2021-03-11 19:13:27 +05:30
end
2021-06-08 01:23:25 +05:30
def message
_('Configure SAST in `.gitlab-ci.yml`, creating this file if it does not already exist')
2021-03-11 19:13:27 +05:30
end
2021-06-08 01:23:25 +05:30
def description
_('Configure SAST in `.gitlab-ci.yml` using the GitLab managed template. You can [add variable overrides](https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings) to customize SAST settings.')
2021-03-11 19:13:27 +05:30
end
end
end
end