From 1861060bdae1ff1dc633118082ac7510bcc74c37 Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins Date: Fri, 25 Jul 2025 21:14:29 +0100 Subject: [PATCH] Fix undefined points error in contributor points (#5392) --- .github/scripts/count-points.mjs | 12 ++++++++---- upcoming-release-notes/5392.md | 6 ++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 upcoming-release-notes/5392.md diff --git a/.github/scripts/count-points.mjs b/.github/scripts/count-points.mjs index 1796ddef95..b584ff738f 100644 --- a/.github/scripts/count-points.mjs +++ b/.github/scripts/count-points.mjs @@ -236,16 +236,20 @@ async function countContributorPoints(repo) { ) { const remover = event.actor.login; const userStats = stats.get(remover); - userStats.labelRemovals.push(issue.number.toString()); - userStats.points += config.POINTS_PER_ISSUE_TRIAGE_ACTION; + if (userStats) { + userStats.labelRemovals.push(issue.number.toString()); + userStats.points += config.POINTS_PER_ISSUE_TRIAGE_ACTION; + } } // Check if the issue was closed with "no planned" status if (event.event === 'closed' && event.state_reason === 'not_planned') { const closer = event.actor.login; const userStats = stats.get(closer); - userStats.issueClosings.push(issue.number.toString()); - userStats.points += config.POINTS_PER_ISSUE_CLOSING_ACTION; + if (userStats) { + userStats.issueClosings.push(issue.number.toString()); + userStats.points += config.POINTS_PER_ISSUE_CLOSING_ACTION; + } } }); } diff --git a/upcoming-release-notes/5392.md b/upcoming-release-notes/5392.md new file mode 100644 index 0000000000..875470c333 --- /dev/null +++ b/upcoming-release-notes/5392.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MatissJanis] +--- + +Fix contributor point calculation in July