fix(deploy): substr offset 11 (refs/heads/ tiene 11 chars)
Some checks are pending
Deploy DummyBot / Build & Deploy to ${{ env.DEPLOY_HOST }} (push) Waiting to run

This commit is contained in:
javiservices 2026-06-18 12:18:23 +02:00
parent 00fcbc9a7c
commit 3afc8a1b9c

View File

@ -30,7 +30,7 @@ public function deploy(Request $r): JsonResponse {
$payload = json_decode($body, true) ?: []; $payload = json_decode($body, true) ?: [];
$ref = $payload['ref'] ?? ''; $ref = $payload['ref'] ?? '';
$branch = str_starts_with($ref, 'refs/heads/') ? substr($ref, 10) : 'main'; $branch = str_starts_with($ref, 'refs/heads/') ? substr($ref, 11) : 'main';
if (! in_array($branch, ['main', 'master'], true)) { if (! in_array($branch, ['main', 'master'], true)) {
Log::info("[webhook] push a '$branch' ignorado"); Log::info("[webhook] push a '$branch' ignorado");