fix: no action in webhooks

This commit is contained in:
Andras Bacsai 2023-12-15 14:09:14 +01:00
parent 3b6d3343c7
commit 468ad7d904
4 changed files with 6 additions and 7 deletions

View File

@ -7,7 +7,7 @@
// The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
'release' => '4.0.0-beta.163',
'release' => '4.0.0-beta.164',
// When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'),

View File

@ -1,3 +1,3 @@
<?php
return '4.0.0-beta.163';
return '4.0.0-beta.164';

View File

@ -67,7 +67,6 @@
try {
$payload = request()->collect();
$headers = request()->headers->all();
ray($payload, $headers);
$x_gitlab_token = data_get($headers, 'x-gitlab-token.0');
$x_gitlab_event = data_get($payload, 'object_kind');
if ($x_gitlab_event === 'push') {
@ -83,7 +82,6 @@
}
if ($x_gitlab_event === 'merge_request') {
$action = data_get($payload, 'object_attributes.action');
ray($action);
$branch = data_get($payload, 'object_attributes.source_branch');
$base_branch = data_get($payload, 'object_attributes.target_branch');
$full_name = data_get($payload, 'project.path_with_namespace');
@ -159,8 +157,7 @@
ray('Preview deployments disabled for ' . $application->name);
return response('Nothing to do. Preview Deployments disabled.');
}
}
if ($action === 'closed') {
} else if ($action === 'closed') {
$found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first();
if ($found) {
$found->delete();
@ -170,6 +167,8 @@
return response('Preview Deployment closed.');
}
return response('Nothing to do. No Preview Deployment found');
} else {
return response('No action found. Contact us for debugging.', 500);
}
}
}

View File

@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
"version": "4.0.0-beta.163"
"version": "4.0.0-beta.164"
}
}
}