Skip to content

Commit

Permalink
When passing -v option, show some debugging output to debug potential…
Browse files Browse the repository at this point in the history
… issues with the GH Api/Webhooks API request
  • Loading branch information
maarten00 committed Feb 28, 2025
1 parent e8d6c9a commit b5aab7f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/Commands/MergeLatestTagCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, [
Expand Down
9 changes: 7 additions & 2 deletions src/Commands/PrMergeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down
9 changes: 8 additions & 1 deletion src/Commands/PublishReleaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down

0 comments on commit b5aab7f

Please sign in to comment.