From 684745902241eaa49180d97636ed0db4293b8f5b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 16 May 2024 13:33:35 +0200 Subject: [PATCH] chore: Limit commit message length to 50 characters in ApplicationDeploymentJob --- app/Jobs/ApplicationDeploymentJob.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 07a9f6fa8..e542a67b4 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -1179,8 +1179,11 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted ] ); if ($this->saved_outputs->get('commit_message')) { - $this->application_deployment_queue->commit_message = $this->saved_outputs->get('commit_message'); - ApplicationDeploymentQueue::whereCommit($this->commit)->whereApplicationId($this->application->id)->update(['commit_message' => $this->saved_outputs->get('commit_message')]); + $commit_message = str($this->saved_outputs->get('commit_message'))->limit(50); + $this->application_deployment_queue->commit_message = $commit_message->value(); + ApplicationDeploymentQueue::whereCommit($this->commit)->whereApplicationId($this->application->id)->update( + ['commit_message' => $commit_message->value()] + ); $this->application_deployment_queue->save(); } }