Skip to content

Commit

Permalink
fix(sponsors): Work around tier being null (#3575)
Browse files Browse the repository at this point in the history
* fix(sponsors): Work around `tier` being `null`

* format
  • Loading branch information
fb55 authored Jan 2, 2024
1 parent 4f6dc61 commit 8b1089b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/sponsors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:
- name: Update the README
run: npm run update-sponsors
env:
CHEERIO_SPONSORS_GITHUB_TOKEN:
${{ secrets.GITHUB_TOKEN }}
CHEERIO_SPONSORS_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMGIX_TOKEN: ${{ secrets.IMGIX_TOKEN }}

- name: Create Pull Request
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ npm-debug.log
/coverage
/lib
/website/docs/api
/website/build
4 changes: 2 additions & 2 deletions scripts/fetch-sponsors.mts
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ async function fetchGitHubSponsors(): Promise<Sponsor[]> {
type:
// Workaround to get the type — fetch a field that only exists on users.
sponsor.isViewer === undefined ? 'ORGANIZATION' : 'INDIVIDUAL',
monthlyDonation: tier.monthlyPriceInDollars * 100,
monthlyDonation: (tier?.monthlyPriceInDollars ?? 0) * 100,
totalDonations:
getMonthsActive(createdAt) * tier.monthlyPriceInDollars * 100,
source: 'github',
tier: getTierSlug(tier.monthlyPriceInDollars),
tier: getTierSlug(tier?.monthlyPriceInDollars ?? 0),
}),
);
}
Expand Down

0 comments on commit 8b1089b

Please sign in to comment.