mirror of
https://github.com/LukeHagar/stats-action.git
synced 2025-12-06 04:21:26 +00:00
Added handling for errored repo queries
This commit is contained in:
@@ -364,10 +364,15 @@ try {
|
||||
}
|
||||
}
|
||||
|
||||
const contributorStats = (await Promise.all(contributorStatsPromises))
|
||||
const contributorStats = (await Promise.allSettled(contributorStatsPromises))
|
||||
.filter((entry) => entry !== null || entry !== undefined)
|
||||
.map((entry) => {
|
||||
return (Array.isArray(entry.data) ? entry.data : [entry.data])
|
||||
if (entry.status === "rejected") {
|
||||
return [];
|
||||
}
|
||||
return (
|
||||
Array.isArray(entry.value.data) ? entry.value.data : [entry.value.data]
|
||||
)
|
||||
.filter(
|
||||
(contributor) => contributor.author?.login === userDetails.data.login
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user