fix: webhooks should not run if server is not functional

This commit is contained in:
Andras Bacsai 2023-09-12 13:10:39 +02:00
parent 6266a5e500
commit c76a1b1ba5

View File

@ -119,6 +119,11 @@
return response('Nothing to do. No applications found.');
}
foreach ($applications as $application) {
$isFunctional = $application->destination->server->isFunctional();
if (!$isFunctional) {
ray('Server is not functional: ' . $application->destination->server->name);
continue;
}
if ($x_github_event === 'push') {
if ($application->isDeployable()) {
ray('Deploying ' . $application->name . ' with branch ' . $branch);