8000 [CI] Sort packages by length to match modified package better by Nyholm · Pull Request #40928 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[CI] Sort packages by length to match modified package better #40928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[CI] Sort packages by length to match modified package better
  • Loading branch information
Nyholm committed Apr 27, 2021
commit f7a0bd1047cb1be08d756aa68f9f7d318a38f3b7
5 changes: 5 additions & 0 deletions .github/get-modified-packages.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
0