Skip to content

Commit

Permalink
Update MatrixCommand.php
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Feb 11, 2023
1 parent ce53a05 commit 74bf4f1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Command/MatrixCommand.php
Expand Up @@ -7,7 +7,6 @@
use Ghostwriter\Compliance\Compliance;
use Ghostwriter\Compliance\Event\MatrixEvent;
use Ghostwriter\Environment\Environment;
use Ghostwriter\Json\Json;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -39,21 +38,18 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$environment = new Environment();

$matrix = sprintf("matrix=%s".PHP_EOL, $matrixEvent->getMatrix());
$matrix = sprintf('matrix=%s' . PHP_EOL, $matrixEvent->getMatrix());
file_put_contents(
$environment->getServerVariable(
'GITHUB_OUTPUT',
tempnam(sys_get_temp_dir(),'GITHUB_OUTPUT')
),
$environment->getServerVariable('GITHUB_OUTPUT', tempnam(sys_get_temp_dir(), 'GITHUB_OUTPUT')),
$matrix,
FILE_APPEND
);

$gitHubOutput = $this->container->has(Compliance::PATH_CONFIG) ?
'Registered config path: ' . $this->container->get(Compliance::PATH_CONFIG) . PHP_EOL.PHP_EOL :
'Registered config path: ' . $this->container->get(Compliance::PATH_CONFIG) . PHP_EOL . PHP_EOL :
'';

$this->write($gitHubOutput.$matrix);
$this->write($gitHubOutput . $matrix);

return $matrixEvent->isPropagationStopped() ? self::FAILURE : self::SUCCESS;
}
Expand Down

0 comments on commit 74bf4f1

Please sign in to comment.