improvements to release PR points counting logic (#5450)

* do not credit reviewers of release PRs

* make release regex more flexible
This commit is contained in:
Matt Fiddaman
2025-08-02 15:31:04 -04:00
committed by GitHub
parent 239a087542
commit 8d84f16604

View File

@@ -166,22 +166,24 @@ async function countContributorPoints(repo) {
.reduce((sum, file) => sum + file.additions + file.deletions, 0);
// Check if this is a release PR
const isReleasePR = pr.title.match(/^🔖 \(\d+\.\d+\.\d+\)/);
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 ?? 0;
// Award points to the PR creator if it's a release PR
if (isReleasePR && stats.has(pr.user.login)) {
const creatorStats = stats.get(pr.user.login);
creatorStats.reviews.push({
pr: pr.number.toString(),
points: config.POINTS_PER_RELEASE_PR,
isReleaseCreator: true,
});
creatorStats.points += config.POINTS_PER_RELEASE_PR;
if (isReleasePR) {
// Award points to the PR creator if it's a release PR
if (stats.has(pr.user.login)) {
const creatorStats = stats.get(pr.user.login);
creatorStats.reviews.push({
pr: pr.number.toString(),
points: config.POINTS_PER_RELEASE_PR,
isReleaseCreator: true,
});
creatorStats.points += config.POINTS_PER_RELEASE_PR;
}
} else {
// Add points to the reviewers
const uniqueReviewers = new Set();