summaryrefslogtreecommitdiffstats
path: root/modules/migrations/github.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-10-05 19:09:27 +0800
committerLauris BH <lauris@nix.lv>2019-10-05 14:09:27 +0300
commitbd41a04a5613a2e017b458351bea0f02b767b893 (patch)
treed13e42c1f9664e09ae432250caaeca78df70ee72 /modules/migrations/github.go
parentfb7c23f911bebcb72f170f3d8bc8343546805f3b (diff)
downloadgitea-bd41a04a5613a2e017b458351bea0f02b767b893.tar.gz
gitea-bd41a04a5613a2e017b458351bea0f02b767b893.zip
Add extra user information when migrating release (#8331)
* add extra user information when migrating release * add migrations * fix tests
Diffstat (limited to 'modules/migrations/github.go')
-rw-r--r--modules/migrations/github.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/migrations/github.go b/modules/migrations/github.go
index c5f29cabb7..754f98941c 100644
--- a/modules/migrations/github.go
+++ b/modules/migrations/github.go
@@ -214,6 +214,11 @@ func (g *GithubDownloaderV3) convertGithubRelease(rel *github.RepositoryRelease)
name = *rel.Name
}
+ var email string
+ if rel.Author.Email != nil {
+ email = *rel.Author.Email
+ }
+
r := &base.Release{
TagName: *rel.TagName,
TargetCommitish: *rel.TargetCommitish,
@@ -222,6 +227,9 @@ func (g *GithubDownloaderV3) convertGithubRelease(rel *github.RepositoryRelease)
Draft: *rel.Draft,
Prerelease: *rel.Prerelease,
Created: rel.CreatedAt.Time,
+ PublisherID: *rel.Author.ID,
+ PublisherName: *rel.Author.Login,
+ PublisherEmail: email,
Published: rel.PublishedAt.Time,
}