diff options
-rw-r--r-- | cmd/generate/src_contribs.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/cmd/generate/src_contribs.go b/cmd/generate/src_contribs.go index 6db6764..f22f721 100644 --- a/cmd/generate/src_contribs.go +++ b/cmd/generate/src_contribs.go @@ -266,8 +266,15 @@ func (c Contribution) fetchLastUpdated() (time.Time, User, error) { var obj struct { UpdatedAt time.Time `json:"updated_at"` - MergedAt time.Time `json:"merged_at"` - MergedBy struct { + + CreatedAt time.Time `json:"created_at"` + CreatedBy struct { + Login string `json:"login"` + HTMLURL string `json:"html_url"` + } `json:"user"` + + MergedAt time.Time `json:"merged_at"` + MergedBy struct { Login string `json:"login"` HTMLURL string `json:"html_url"` } `json:"merged_by"` @@ -279,7 +286,11 @@ func (c Contribution) fetchLastUpdated() (time.Time, User, error) { retUpdatedAt := obj.UpdatedAt var retUser User - if obj.MergedAt == retUpdatedAt { + if retUser == (User{}) && obj.CreatedAt == retUpdatedAt { + retUser.Name = obj.CreatedBy.Login + retUser.URL = obj.CreatedBy.HTMLURL + } + if retUser == (User{}) && obj.MergedAt == retUpdatedAt { retUser.Name = obj.MergedBy.Login retUser.URL = obj.MergedBy.HTMLURL } |