Fix auto-deployment branch (#506)

This commit is contained in:
Saeed Vaziry
2025-02-23 12:50:46 +01:00
committed by GitHub
parent 1223ea1499
commit e99146209e
6 changed files with 189 additions and 13 deletions

View File

@ -29,7 +29,8 @@ public function __invoke(Request $request)
->firstOrFail();
foreach ($gitHook->actions as $action) {
if ($action == 'deploy') {
$webhookBranch = $gitHook->site->sourceControl->provider()->getWebhookBranch($request->array());
if ($action == 'deploy' && $gitHook->site->branch === $webhookBranch) {
try {
app(Deploy::class)->run($gitHook->site);
} catch (SourceControlIsNotConnected) {