diff --git a/src/Commands/MergeLatestTagCommand.php b/src/Commands/MergeLatestTagCommand.php index 153e8b5..1e651eb 100644 --- a/src/Commands/MergeLatestTagCommand.php +++ b/src/Commands/MergeLatestTagCommand.php @@ -56,6 +56,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int ] ); + if ($input->getOption('verbose')) { + $output->writeln('Response:'); + $output->writeLn(' Status: '.$response->getStatusCode()); + $output->writeLn(' Body: '.$response->getBody()->getContents()); + $output->writeLn(''); + } + $release = json_decode($response->getBody(), true); return $this->call($input, $output, [ diff --git a/src/Commands/PrMergeCommand.php b/src/Commands/PrMergeCommand.php index c1e5907..627a42d 100644 --- a/src/Commands/PrMergeCommand.php +++ b/src/Commands/PrMergeCommand.php @@ -101,7 +101,7 @@ protected function call(InputInterface $input, OutputInterface $output, array $s // Construct and execute the request. $client = new Client(); - $client->post( + $response = $client->post( $_ENV['DESTINATION_URL'], [ 'body' => $payload, @@ -112,7 +112,12 @@ protected function call(InputInterface $input, OutputInterface $output, array $s ], ] ); - + if ($input->getOption('verbose')) { + $output->writeln('Response:'); + $output->writeLn(' Status: '.$response->getStatusCode()); + $output->writeLn(' Body: '.$response->getBody()->getContents()); + $output->writeLn(''); + } $output->writeLn('Done.'); return 0; diff --git a/src/Commands/PublishReleaseCommand.php b/src/Commands/PublishReleaseCommand.php index 5d7da2d..57b25d3 100644 --- a/src/Commands/PublishReleaseCommand.php +++ b/src/Commands/PublishReleaseCommand.php @@ -81,7 +81,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int // Construct and execute the request. $client = new Client(); - $client->post( + $response = $client->post( $_ENV['DESTINATION_URL'], [ 'body' => $payload, @@ -93,6 +93,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int ] ); + if ($input->getOption('verbose')) { + $output->writeln('Response:'); + $output->writeLn(' Status: '.$response->getStatusCode()); + $output->writeLn(' Body: '.$response->getBody()->getContents()); + $output->writeLn(''); + } + $output->writeLn('Done.'); return 0;