summaryrefslogtreecommitdiff
path: root/lib/gitlab/github_import/importer/releases_importer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/github_import/importer/releases_importer.rb')
-rw-r--r--lib/gitlab/github_import/importer/releases_importer.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/gitlab/github_import/importer/releases_importer.rb b/lib/gitlab/github_import/importer/releases_importer.rb
index 9d925581441..a3734ccf069 100644
--- a/lib/gitlab/github_import/importer/releases_importer.rb
+++ b/lib/gitlab/github_import/importer/releases_importer.rb
@@ -32,11 +32,13 @@ module Gitlab
def build(release)
{
+ name: release.name,
tag: release.tag_name,
description: description_for(release),
created_at: release.created_at,
- updated_at: release.updated_at,
- released_at: release.published_at,
+ updated_at: release.created_at,
+ # Draft releases will have a null published_at
+ released_at: release.published_at || Time.current,
project_id: project.id
}
end
@@ -46,11 +48,7 @@ module Gitlab
end
def description_for(release)
- if release.body.present?
- release.body
- else
- "Release for tag #{release.tag_name}"
- end
+ release.body.presence || "Release for tag #{release.tag_name}"
end
end
end