From 685d3e87e9917b4d3c6587bdffad1a092251fd2a Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Sun, 25 Jan 2026 16:03:07 -0500 Subject: [PATCH 1/2] ci/github-script/bot: only look at commit subject when deciding if a package is new/updated (cherry picked from commit c717c98bc83e34233c493c6d65fc73e9756d4a22) --- ci/github-script/bot.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ci/github-script/bot.js b/ci/github-script/bot.js index b3c3af8ec389d..19e478f16861e 100644 --- a/ci/github-script/bot.js +++ b/ci/github-script/bot.js @@ -332,13 +332,15 @@ module.exports = async ({ github, context, core, dry }) => { pull_number, per_page: 100, }) - const commitMessages = prCommits.map((c) => c.commit.message) + const commitSubjects = prCommits.map( + (c) => c.commit.message.split('\n')[0], + ) // Label new package PRs: "packagename: init at X.Y.Z" // Exclude NixOS module commits like "nixos/timekpr: init at 0.5.8" const newPackagePattern = /(? 0 - const commitsIndicateNewPackage = commitMessages.some((msg) => + const commitsIndicateNewPackage = commitSubjects.some((msg) => newPackagePattern.test(msg), ) evalLabels['8.has: package (new)'] = @@ -348,7 +350,7 @@ module.exports = async ({ github, context, core, dry }) => { // Matches versions like: 1.2.3, 0-unstable-2024-01-15, 1.3rc1, alpha, unstable // Exclude NixOS module commits like "nixos/ncps: types.str -> types.path" const updatePackagePattern = /(?|→) [\w.-]+/ - const commitsIndicateUpdate = commitMessages.some((msg) => + const commitsIndicateUpdate = commitSubjects.some((msg) => updatePackagePattern.test(msg), ) evalLabels['8.has: package (update)'] = commitsIndicateUpdate From d55bc207cc12a668d8dcd9ff76d37accd4479775 Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Sun, 25 Jan 2026 20:15:55 -0500 Subject: [PATCH 2/2] ci/github-script/bot: refine regexes (cherry picked from commit 31876b4580eac2e782bf782e153b745c06464cf7) --- ci/github-script/bot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/github-script/bot.js b/ci/github-script/bot.js index 19e478f16861e..efb0b1e0a11c1 100644 --- a/ci/github-script/bot.js +++ b/ci/github-script/bot.js @@ -338,7 +338,7 @@ module.exports = async ({ github, context, core, dry }) => { // Label new package PRs: "packagename: init at X.Y.Z" // Exclude NixOS module commits like "nixos/timekpr: init at 0.5.8" - const newPackagePattern = /(? 0 const commitsIndicateNewPackage = commitSubjects.some((msg) => newPackagePattern.test(msg), @@ -349,7 +349,8 @@ module.exports = async ({ github, context, core, dry }) => { // Label package update PRs: "packagename: X.Y.Z -> A.B.C" // Matches versions like: 1.2.3, 0-unstable-2024-01-15, 1.3rc1, alpha, unstable // Exclude NixOS module commits like "nixos/ncps: types.str -> types.path" - const updatePackagePattern = /(?|→) [\w.-]+/ + const updatePackagePattern = + /^(?|→) [\w.-]*\d[\w.-]*$/ const commitsIndicateUpdate = commitSubjects.some((msg) => updatePackagePattern.test(msg), )