From 2c3797de2fa5cdbf268f2662125fefd1c1fdfbdd Mon Sep 17 00:00:00 2001 From: Matt Fiddaman Date: Tue, 21 Jul 2026 23:38:26 +0300 Subject: [PATCH] fix maintainer points counting script PR categorisation (#8535) * fix count points release note finding * note * coderabbit --- .github/scripts/count-points.mjs | 17 +++++++++++++---- upcoming-release-notes/count-points-fix.md | 6 ++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 upcoming-release-notes/count-points-fix.md diff --git a/.github/scripts/count-points.mjs b/.github/scripts/count-points.mjs index 0b8a376ead..6beffc14f1 100644 --- a/.github/scripts/count-points.mjs +++ b/.github/scripts/count-points.mjs @@ -296,10 +296,19 @@ async function countContributorPoints() { // Award points to PR author if they are a core maintainer const prAuthor = pr.user?.login; if (prAuthor && orgMemberLogins.has(prAuthor)) { - const releaseNoteFile = modifiedFiles.find( - file => - file.filename === `upcoming-release-notes/${pr.number}.md`, - ); + const isReleaseNoteFile = file => + file.filename.startsWith('upcoming-release-notes/') && + file.filename.endsWith('.md') && + file.filename !== 'upcoming-release-notes/README.md'; + const releaseNoteFile = + modifiedFiles.find( + file => + file.filename === `upcoming-release-notes/${pr.number}.md` && + file.status !== 'removed', + ) ?? + modifiedFiles.find( + file => file.status === 'added' && isReleaseNoteFile(file), + ); const categoryAndPoints = await getPRCategoryAndPoints( octokit, owner, diff --git a/upcoming-release-notes/count-points-fix.md b/upcoming-release-notes/count-points-fix.md new file mode 100644 index 0000000000..65fb28c169 --- /dev/null +++ b/upcoming-release-notes/count-points-fix.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [matt-fidd] +--- + +Fix maintainer points counting script PR categorisation