summaryrefslogtreecommitdiff
path: root/lib/api/templates.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/templates.rb')
-rw-r--r--lib/api/templates.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/templates.rb b/lib/api/templates.rb
index 9f5f10a5088..33cbb0c9e1b 100644
--- a/lib/api/templates.rb
+++ b/lib/api/templates.rb
@@ -2,7 +2,7 @@ module API
class Templates < Grape::API
TEMPLATE_TYPES = {
gitignores: Gitlab::Template::Gitignore,
- gitlab_ci_ymls: Gitlab::Template::GitlabCIYml
+ gitlab_ci_ymls: Gitlab::Template::GitlabCiYml
}.freeze
TEMPLATE_TYPES.each do |template, klass|
@@ -29,6 +29,10 @@ module API
new_template = klass.find(params[:name])
not_found!("#{template.to_s.singularize}") unless new_template
+ if new_template.class == Gitlab::Template::GitlabCiYml
+ new_template.content = "# This file is a template, and might need editing before it works on your project.\n" + new_template.content
+ end
+
present new_template, with: Entities::Template
end
end