gitlab-org--gitlab-foss/lib/api/lint.rb
Kamil Trzciński c4d615c9dc Allow to include files from another projects
This adds `project:, file:, ref:` specification support.
2019-01-07 09:38:05 +01:00

24 lines
560 B
Ruby

# frozen_string_literal: true
module API
class Lint < Grape::API
namespace :ci do
desc 'Validation of .gitlab-ci.yml content'
params do
requires :content, type: String, desc: 'Content of .gitlab-ci.yml'
end
post '/lint' do
error = Gitlab::Ci::YamlProcessor.validation_message(params[:content],
user: current_user)
status 200
if error.blank?
{ status: 'valid', errors: [] }
else
{ status: 'invalid', errors: [error] }
end
end
end
end
end