Fix potential undefined points issue in contributor points calculation (#5393)

This commit is contained in:
Matiss Janis Aboltins
2025-07-26 07:48:09 +01:00
committed by GitHub
parent a15ff85c20
commit 45530638fe
2 changed files with 10 additions and 3 deletions

View File

@@ -161,9 +161,9 @@ async function countContributorPoints(repo) {
const isReleasePR = pr.title.match(/^🔖 \(\d+\.\d+\.\d+\)/);
// Calculate points for reviewers based on PR size
const prPoints = config.PR_REVIEW_POINT_TIERS.find(
tier => totalChanges > tier.minChanges,
).points;
const prPoints =
config.PR_REVIEW_POINT_TIERS.find(tier => totalChanges > tier.minChanges)
?.points ?? 0;
// Award points to the PR creator if it's a release PR
if (isReleasePR && stats.has(pr.user.login)) {