Finish github webhooks integration

This commit is contained in:
Frédéric Guillot
2014-10-25 18:13:13 -04:00
parent 7af67934cf
commit c4e6d658e4
23 changed files with 348 additions and 15 deletions

View File

@@ -54,6 +54,7 @@ class Project extends Base
$this->response->html($this->projectLayout('project_show', array(
'project' => $project,
'stats' => $this->project->getStats($project['id']),
'webhook_token' => $this->config->get('webhook_token'),
'title' => $project['name'],
)));
}

View File

@@ -55,9 +55,11 @@ class Webhook extends Base
$this->githubWebhook->setProjectId($this->request->getIntegerParam('project_id'));
$this->githubWebhook->parsePayload(
$result = $this->githubWebhook->parsePayload(
$this->request->getHeader('X-Github-Event'),
$this->request->getBody()
);
echo $result ? 'PARSED' : 'IGNORED';
}
}