From f7a0bd1047cb1be08d756aa68f9f7d318a38f3b7 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Fri, 23 Apr 2021 16:10:57 +0200 Subject: [PATCH] [CI] Sort packages by length to match modified package better --- .github/get-modified-packages.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/get-modified-packages.php b/.github/get-modified-packages.php index b78d103b9f2ce..9135a1da666e5 100644 --- a/.github/get-modified-packages.php +++ b/.github/get-modified-packages.php @@ -12,6 +12,11 @@ $allPackages = json_decode($_SERVER['argv'][1], true, 512, \JSON_THROW_ON_ERROR); $modifiedFiles = json_decode($_SERVER['argv'][2], true, 512, \JSON_THROW_ON_ERROR); +// Sort to get the longest name first (match bridge not component) +usort($allPackages, function($a, $b) { + return strlen($b) <=> strlen($a) ?: $a <=> $b; +}); + function isComponentBridge(string $packageDir): bool { return 0 < preg_match('@Symfony/Component/.*/Bridge/@', $packageDir);