summaryrefslogtreecommitdiff
path: root/lib/ci
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ci')
-rw-r--r--lib/ci/gitlab_ci_yaml_processor.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb
index 47efd5bd9f2..9799f494df6 100644
--- a/lib/ci/gitlab_ci_yaml_processor.rb
+++ b/lib/ci/gitlab_ci_yaml_processor.rb
@@ -78,6 +78,15 @@ module Ci
}
end
+ def self.validate(content)
+ begin
+ Ci::GitlabCiYamlProcessor.new(content)
+ "valid"
+ rescue ValidationError, Psych::SyntaxError => e
+ e.message
+ end
+ end
+
private
def initial_parsing