Skip to content

Commit

Permalink
Improve the security update report
Browse files Browse the repository at this point in the history
Now security updates do not stop the execution of the job. IN addition
to it, there won't be duplicates between composer audit and drupal pm
security
  • Loading branch information
omarlopesino committed May 30, 2023
1 parent 2f5c2b0 commit a3cf121
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/UpdaterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,18 @@ protected function showPendingUpdates() {

$this->output->writeln('');
$this->printHeader2('Not Updated Securities (ALL):');
$this->output->writeln(
$this->runCommand('composer audit --locked')->getOutput()
);
$composer_audit_securities = trim($this->runCommand('composer audit --locked --format plain 2>&1 | grep ^Package | cut -f2 -d: | sort -u')->getOutput());

$this->output->writeln(
$this->runCommand('./vendor/bin/drush pm:security --fields=name --format=list 2>/dev/null')->getOutput(),
);
try {
$drupal_securities = trim($this->runCommand('./vendor/bin/drush pm:security --fields=name --format=list 2>/dev/null')->getOutput());
}
catch (ProcessFailedException $e) {
$drupal_securities = trim($e->getProcess()->getOutput());
}

$securities = implode("\n", array_unique(explode("\n", $drupal_securities)));
$this->output->writeln($securities);
$this->output->writeln("");
}
}

Expand Down

0 comments on commit a3cf121

Please sign in to comment.