diff --git a/src/PHPCensor/Controller/WebhookController.php b/src/PHPCensor/Controller/WebhookController.php index 29405690..4810a8d4 100644 --- a/src/PHPCensor/Controller/WebhookController.php +++ b/src/PHPCensor/Controller/WebhookController.php @@ -400,6 +400,27 @@ class WebhookController extends Controller return ['status' => 'ignored', 'message' => 'Unusable payload.']; } + + /** + * Called by POSTing to /webhook/svn/?branch=&commit= + * + * @author Sylvain Lévesque + * + * @param string $projectId + * + * @return array + */ + public function svn($projectId) + { + $project = $this->fetchProject($projectId, 'svn'); + $branch = $this->getParam('branch', $project->getBranch()); + $commit = $this->getParam('commit'); + $commitMessage = $this->getParam('message'); + $committer = $this->getParam('committer'); + + return $this->createBuild($project, $commit, $branch, $committer, $commitMessage); + } + /** * Wrapper for creating a new build. *