Skip to content

Commit

Permalink
Deploy Production Code for Commit dcb657f 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Dec 17, 2024
1 parent dcb657f commit 1a120c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export interface Sponsor {
name: string | null;
login: string;
url: string;
avatarUrl: string;
avatarUrl?: string;
websiteUrl: string | null;
};
createdAt: string;
Expand Down
8 changes: 6 additions & 2 deletions lib/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ function getSponsors(action) {
login
url
websiteUrl
avatarUrl
}
... on User {
name
login
url
websiteUrl
avatarUrl
}
}
createdAt
Expand Down Expand Up @@ -144,7 +142,13 @@ function generateTemplate(response, action) {
websiteUrl: (0, util_1.sanitizeAndClean)(sponsorEntity.websiteUrl || sponsorEntity.url),
name: (0, util_1.sanitizeAndClean)(sponsorEntity.name || ''),
login: (0, util_1.sanitizeAndClean)(sponsorEntity.login),
/**
* The avatar URL provided by the GitHub API includes an expiration token so we circumvent this for now
* by using a path that is always available.
*/
avatarUrl: sponsorEntity.avatarUrl
? sponsorEntity.avatarUrl
: `https://github.com/${(0, util_1.sanitizeAndClean)(sponsorEntity.login)}.png`
};
/**
* Ensure that the template is safe to render by preventing the usage of triple brackets.
Expand Down

0 comments on commit 1a120c9

Please sign in to comment.