From 5bc242a854dbd5af7e2c582ed8844eeed37e862a Mon Sep 17 00:00:00 2001 From: Inga Lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Tue, 29 Jul 2014 17:58:02 +0400 Subject: [PATCH] Improved compatibility with new hooks api --- BuildServer/routes/postreceive.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BuildServer/routes/postreceive.js b/BuildServer/routes/postreceive.js index 920b9d8..e153633 100644 --- a/BuildServer/routes/postreceive.js +++ b/BuildServer/routes/postreceive.js @@ -9,6 +9,12 @@ module.exports = function (req, res) { return res.end(); } + if (req.header("x-github-event") !== "push") { + console.log("Got '" + req.header("x-github-event") + "' event:"); + //console.log(req.body); + return res.send("Only push events are supported"); + } + var payload = req.body.payload ? JSON.parse(req.body.payload) : req.body, repository = payload.repository;