From c2f0a10463e34b5e483dfdf0475b6d017c004246 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 18 May 2018 10:06:27 +0100 Subject: [PATCH] Correct for Github payload differences --- src/http/GitDeployController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/http/GitDeployController.php b/src/http/GitDeployController.php index 5eed32f..440107a 100644 --- a/src/http/GitDeployController.php +++ b/src/http/GitDeployController.php @@ -218,6 +218,12 @@ public function gitHook(Request $request) $postdata['commits'][$commit_key]['human_date'] = $date_str; } + // Standardise formats for Gitlab / Github payload differences + if (isset($postdata['pusher']) && !empty($postdata['pusher'])) { + $postdata['user_name'] = $postdata['pusher']['name']; + $postdata['user_email'] = $postdata['pusher']['email']; + } + // Use package's own sender or the project default? $addressdata['sender_name'] = config('mail.from.name'); $addressdata['sender_address'] = config('mail.from.address');