summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-05-18 22:23:39 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-05-18 22:23:39 -0600
commitcf2f151129362b678e1bbcba0d240653269ebb0a (patch)
tree0e701dc5204db0e0013785526cd4af1a68735e3d
parent0d29240ff227e07061a8ab4bb750efb3b3399e2e (diff)
imworkingon: Fix updated-by for GH PRs that haven't been updated
-rw-r--r--cmd/generate/src_contribs.go17
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
}