gitlab-org--gitlab-foss/app/controllers/projects/ci/lints_controller.rb
Mayra Cabrera 56c95fb6a1 Changes ci/lints controller to use authorize before action
Also includes a comment on Ci::Config regarding that's going to be
override by EE
2018-03-26 17:03:12 -06:00

27 lines
675 B
Ruby

class Projects::Ci::LintsController < Projects::ApplicationController
before_action :authorize_create_pipeline!
def show
end
def create
@content = params[:content]
@error = Gitlab::Ci::YamlProcessor.validation_message(@content, yaml_processor_options)
@status = @error.blank?
if @error.blank?
@config_processor = Gitlab::Ci::YamlProcessor.new(@content, yaml_processor_options)
@stages = @config_processor.stages
@builds = @config_processor.builds
@jobs = @config_processor.jobs
end
render :show
end
private
def yaml_processor_options
{ project: @project, sha: project.repository.commit.sha }
end
end