File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export interface Sponsor {
67
67
name : string | null ;
68
68
login : string ;
69
69
url : string ;
70
- avatarUrl : string ;
70
+ avatarUrl ? : string ;
71
71
websiteUrl : string | null ;
72
72
} ;
73
73
createdAt : string ;
Original file line number Diff line number Diff line change @@ -41,14 +41,12 @@ function getSponsors(action) {
41
41
login
42
42
url
43
43
websiteUrl
44
- avatarUrl
45
44
}
46
45
... on User {
47
46
name
48
47
login
49
48
url
50
49
websiteUrl
51
- avatarUrl
52
50
}
53
51
}
54
52
createdAt
@@ -144,7 +142,13 @@ function generateTemplate(response, action) {
144
142
websiteUrl : ( 0 , util_1 . sanitizeAndClean ) ( sponsorEntity . websiteUrl || sponsorEntity . url ) ,
145
143
name : ( 0 , util_1 . sanitizeAndClean ) ( sponsorEntity . name || '' ) ,
146
144
login : ( 0 , util_1 . sanitizeAndClean ) ( sponsorEntity . login ) ,
145
+ /**
146
+ * The avatar URL provided by the GitHub API includes an expiration token so we circumvent this for now
147
+ * by using a path that is always available.
148
+ */
147
149
avatarUrl : sponsorEntity . avatarUrl
150
+ ? sponsorEntity . avatarUrl
151
+ : `https://github.com/${ ( 0 , util_1 . sanitizeAndClean ) ( sponsorEntity . login ) } .png`
148
152
} ;
149
153
/**
150
154
* Ensure that the template is safe to render by preventing the usage of triple brackets.
You can’t perform that action at this time.
0 commit comments