debian-mirror-gitlab/lib/api/lint.rb

22 lines
499 B
Ruby
Raw Normal View History

2016-09-29 09:46:39 +05:30
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
2018-03-17 18:26:18 +05:30
error = Gitlab::Ci::YamlProcessor.validation_message(params[:content])
2016-09-29 09:46:39 +05:30
status 200
if error.blank?
{ status: 'valid', errors: [] }
else
{ status: 'invalid', errors: [error] }
end
end
end
end
end