Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/lint.rb')
-rw-r--r--lib/api/lint.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/api/lint.rb b/lib/api/lint.rb
index 58181adaa93..f1f34622187 100644
--- a/lib/api/lint.rb
+++ b/lib/api/lint.rb
@@ -12,14 +12,13 @@ module API
end
post '/lint' do
result = Gitlab::Ci::YamlProcessor.new(params[:content], user: current_user).execute
- error = result.errors.first
status 200
- response = if error.blank?
+ response = if result.errors.empty?
{ status: 'valid', errors: [], warnings: result.warnings }
else
- { status: 'invalid', errors: [error], warnings: result.warnings }
+ { status: 'invalid', errors: result.errors, warnings: result.warnings }
end
response.tap do |response|