diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-06-20 20:55:50 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-06-20 20:55:50 -0400 |
commit | 98fd34bfe340fae6d0fd3b7333b6f9a6647cbae2 (patch) | |
tree | d22b7bff634a05e73f89d423938776df43554f52 /app/Integration/GithubWebhook.php | |
parent | 7b947ebdbd3b6bcd9de10ea4255bfa11fc88695c (diff) |
Improve automatic action to create comments based on commit messages
Diffstat (limited to 'app/Integration/GithubWebhook.php')
-rw-r--r-- | app/Integration/GithubWebhook.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/app/Integration/GithubWebhook.php b/app/Integration/GithubWebhook.php index 607bbc1e..a725f5b9 100644 --- a/app/Integration/GithubWebhook.php +++ b/app/Integration/GithubWebhook.php @@ -90,12 +90,19 @@ class GithubWebhook extends \Core\Base continue; } - if ($task['project_id'] == $this->project_id) { - $this->container['dispatcher']->dispatch( - self::EVENT_COMMIT, - new GenericEvent(array('task_id' => $task_id) + $task) - ); + if ($task['project_id'] != $this->project_id) { + continue; } + + $this->container['dispatcher']->dispatch( + self::EVENT_COMMIT, + new GenericEvent(array( + 'task_id' => $task_id, + 'commit_message' => $commit['message'], + 'commit_url' => $commit['url'], + 'commit_comment' => $commit['message']."\n\n[".t('Commit made by @%s on Github', $commit['author']['username']).']('.$commit['url'].')' + ) + $task) + ); } return true; |