diff options
author | Michael Muré <batolettre@gmail.com> | 2018-10-07 18:27:23 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-10-07 18:27:23 +0200 |
commit | 7cb7994cdae848053487d00c1730d1e865fb8623 (patch) | |
tree | bc9be185e81479d8d3e5b0fc636daea011a64e4c /bridge/github/import.go | |
parent | 03202fed493539c8d1fdcad7254687f951d0ca4a (diff) | |
download | git-bug-7cb7994cdae848053487d00c1730d1e865fb8623.tar.gz |
github: also pull users email
Diffstat (limited to 'bridge/github/import.go')
-rw-r--r-- | bridge/github/import.go | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/bridge/github/import.go b/bridge/github/import.go index ed0135e7..93390408 100644 --- a/bridge/github/import.go +++ b/bridge/github/import.go @@ -565,9 +565,29 @@ func (gi *githubImporter) makePerson(actor *actor) bug.Person { if actor == nil { return gi.ghost } + var name string + var email string + + switch actor.Typename { + case "User": + if actor.User.Name != nil { + name = string(*(actor.User.Name)) + } + email = string(actor.User.Email) + case "Organization": + if actor.Organization.Name != nil { + name = string(*(actor.Organization.Name)) + } + if actor.Organization.Email != nil { + email = string(*(actor.Organization.Email)) + } + case "Bot": + } return bug.Person{ - Name: string(actor.Login), + Name: name, + Email: email, + Login: string(actor.Login), AvatarUrl: string(actor.AvatarUrl), } } @@ -584,9 +604,16 @@ func (gi *githubImporter) fetchGhost() error { return err } + var name string + if q.User.Name != nil { + name = string(*q.User.Name) + } + gi.ghost = bug.Person{ - Name: string(q.User.Login), + Name: name, + Login: string(q.User.Login), AvatarUrl: string(q.User.AvatarUrl), + Email: string(q.User.Email), } return nil |