Skip to content

Commit 240beec

Browse files
committed
chore(sponsors): Log fetch results to GitHub Actions
1 parent 526b1ff commit 240beec

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/fetch-sponsors.mts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,10 @@ async function fetchGitHubSponsors(): Promise<Sponsor[]> {
244244
}
245245

246246
async function fetchSponsors(): Promise<Sponsor[]> {
247-
const openCollectiveSponsors = fetchOpenCollectiveSponsors();
248-
const githubSponsors = fetchGitHubSponsors();
249-
250-
return [...(await openCollectiveSponsors), ...(await githubSponsors)];
247+
return Promise.all([
248+
fetchOpenCollectiveSponsors(),
249+
fetchGitHubSponsors(),
250+
]).then((results) => results.flat());
251251
}
252252

253253
/*
@@ -270,6 +270,8 @@ const professionalToBackerOverrides = new Map([
270270

271271
const sponsors = await fetchSponsors();
272272

273+
console.log('Received sponsors:', sponsors);
274+
273275
// Remove sponsors that are already in the pre-populated headliners
274276
for (let i = 0; i < sponsors.length; i++) {
275277
if (
@@ -309,7 +311,7 @@ for (const tier of Object.values(tierSponsors)) {
309311
// Sort order based on total donations
310312
tier.sort((a: Sponsor, b: Sponsor) => b.totalDonations - a.totalDonations);
311313

312-
// Set all montly donations to 0
314+
// Set all donations to 0 before writing to JSON
313315
for (const sponsor of tier) {
314316
sponsor.monthlyDonation = 0;
315317
sponsor.totalDonations = 0;

0 commit comments

Comments
 (0)