Skip to content

Commit

Permalink
Create debug.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 Sep 30, 2024
1 parent 2e059ea commit c8efcdf
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions debug.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

if (\getenv('RUNNER_DEBUG') !== false) {
$eventPath = \getenv('GITHUB_EVENT_PATH');

if ($eventPath === false) {
echo 'GITHUB_EVENT_PATH not found';
exit(1);
}

$event = \json_decode(\file_get_contents($eventPath), true);

if ($event === null) {
echo 'Failed to parse GITHUB_EVENT_PATH';
exit(1);
}

$environment = \json_decode(\getenv(), true);

if ($environment === null) {
echo 'Failed to parse environment';
exit(1);
}

var_dump([
'event' => $event,
'environment' => $environment,
]);

exit(1);
}

0 comments on commit c8efcdf

Please sign in to comment.