Skip to content

A local-first personal finance app

fix maintainer points counting script PR categorisation (#8535)

Matt Fiddaman2c3797de2fa5
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