From bf5645a0edffd6d7bfe8048a023b8255427cdb71 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Thu, 22 Jan 2026 01:45:41 +0200 Subject: [PATCH] ci(bot): auto-label package updates with '8.has: package (update)' Checks all PR commit messages for version update pattern like 'packagename: X.Y.Z -> A.B.C'. Matches: 1.2.3, 0-unstable-2024-01-15, 1.3rc1, alpha, unstable --- ci/github-script/bot.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ci/github-script/bot.js b/ci/github-script/bot.js index ba53aded5e37..b3c3af8ec389 100644 --- a/ci/github-script/bot.js +++ b/ci/github-script/bot.js @@ -344,6 +344,15 @@ module.exports = async ({ github, context, core, dry }) => { evalLabels['8.has: package (new)'] = hasNewPackages && commitsIndicateNewPackage + // 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 commitsIndicateUpdate = commitMessages.some((msg) => + updatePackagePattern.test(msg), + ) + evalLabels['8.has: package (update)'] = commitsIndicateUpdate + // TODO: Get "changed packages" information from list of changed by-name files // in addition to just the Eval results, to make this work for these packages // when Eval results have expired as well.