mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-12 04:55:06 -05:00
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:
22
.github/scripts/count-points.mjs
vendored
22
.github/scripts/count-points.mjs
vendored
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user