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
Some checks are pending
Deploy DummyBot / Build & Deploy to ${{ env.DEPLOY_HOST }} (push) Waiting to run
This commit is contained in:
parent
00fcbc9a7c
commit
3afc8a1b9c
@ -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");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user