Improve automatic action to create comments based on commit messages

This commit is contained in:
Frederic Guillot
2015-06-20 20:55:50 -04:00
parent 7b947ebdbd
commit 98fd34bfe3
9 changed files with 139 additions and 41 deletions

View File

@@ -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;