Commit 38f2c399 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Always truncate GitHub context name down to 255 chars

parent df56ba11
...@@ -15,11 +15,7 @@ class GithubService ...@@ -15,11 +15,7 @@ class GithubService
end end
def context def context
if @service.static_context? context_name.truncate(255)
"ci/gitlab/#{::Gitlab.config.gitlab.host}"
else
"ci/gitlab/#{@ref_name}".truncate(255)
end
end end
def description def description
...@@ -58,5 +54,15 @@ class GithubService ...@@ -58,5 +54,15 @@ class GithubService
def self.from_pipeline_data(project, service, data) def self.from_pipeline_data(project, service, data)
new(project, service, data[:object_attributes]) new(project, service, data[:object_attributes])
end end
private
def context_name
if @service.static_context?
"ci/gitlab/#{::Gitlab.config.gitlab.host}"
else
"ci/gitlab/#{@ref_name}"
end
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment