Fix undefined points error in contributor points (#5392)

This commit is contained in:
Matiss Janis Aboltins
2025-07-25 21:14:29 +01:00
committed by GitHub
parent 9281acb819
commit 1861060bda
2 changed files with 14 additions and 4 deletions

View File

@@ -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;
}
}
});
}

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MatissJanis]
---
Fix contributor point calculation in July