Skip to content

Commit 2c8a337

Browse files
committed
slack:notifier: Only show updates
1 parent fad787b commit 2c8a337

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/App/Command/SlackNotifierCommand.php

+12-7
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ protected function checkToDoJIRA(): string
357357
protected function checkUITestUpdates(): string
358358
{
359359
$slackMessage = ':scroll: UI Tests (Modules & Theme updates) :scroll:' . PHP_EOL;
360+
$hasUpdates = false;
360361

361362
// Check modules
362363
$content = $this->github->getClient()->api('repo')->contents()->download('PrestaShop', 'PrestaShop', 'tests/UI/data/demo/modules.ts', 'refs/heads/develop');
@@ -372,10 +373,12 @@ protected function checkUITestUpdates(): string
372373

373374
// Search release in Github
374375
$data = $this->github->getClient()->api('repo')->releases()->latest('PrestaShop', $match);
375-
$emoji = $data['name'] === $curVersion ? ':white_check_mark:' : ':warning:';
376376

377-
$slackMessage .= ' • :gear: <https://github.com/PrestaShop/PrestaShop/blob/develop/tests/UI/data/demo/modules.ts|' . $match . '>: Code (`' . $curVersion . '`) - Release (' . $emoji . ' `' . $data['name'] . '`)';
378-
$slackMessage .= PHP_EOL;
377+
if ($data['name'] !== $curVersion) {
378+
$hasUpdates = true;
379+
$slackMessage .= ' • :gear: <https://github.com/PrestaShop/PrestaShop/blob/develop/tests/UI/data/demo/modules.ts|' . $match . '>: Code (`' . $curVersion . '`) - Release (:warning: `' . $data['name'] . '`)';
380+
$slackMessage .= PHP_EOL;
381+
}
379382
}
380383

381384
// Check theme Hummingbird
@@ -386,12 +389,14 @@ protected function checkUITestUpdates(): string
386389

387390
// Search release in Github
388391
$data = $this->github->getClient()->api('repo')->releases()->latest('PrestaShop', 'hummingbird');
389-
$emoji = $data['name'] === $curVersion ? ':white_check_mark:' : ':warning:';
390392

391-
$slackMessage .= ' • :bird: <https://github.com/PrestaShop/PrestaShop/blob/develop/tests/UI/commonTests/FO/hummingbird.ts|hummingbird>: Code (`' . $curVersion . '`) - Release (' . $emoji . ' `' . $data['name'] . '`)';
392-
$slackMessage .= PHP_EOL;
393+
if ($data['name'] !== $curVersion) {
394+
$hasUpdates = true;
395+
$slackMessage .= ' • :bird: <https://github.com/PrestaShop/PrestaShop/blob/develop/tests/UI/commonTests/FO/hummingbird.ts|hummingbird>: Code (`' . $curVersion . '`) - Release (:warning: `' . $data['name'] . '`)';
396+
$slackMessage .= PHP_EOL;
397+
}
393398

394-
return $slackMessage;
399+
return $hasUpdates ? $slackMessage : '';
395400
}
396401

397402
protected function checkStatusNightly(): string

0 commit comments

Comments
 (0)