From 1246cb458d38c1f0472e51ef605cd154cb2a7d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sevilla=20Mart=C3=ADn?= Date: Sun, 27 May 2018 09:39:51 -0400 Subject: [PATCH] fix(web): fix webhooks without action not working... ? Maybe. Refers #31 --- lib/Web.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Web.js b/lib/Web.js index d0210d6..0507dae 100644 --- a/lib/Web.js +++ b/lib/Web.js @@ -47,7 +47,8 @@ app.post('/', (req, res) => { const repo = data.project.path_with_namespace; const channels = ChannelConfig.findByRepo(repo); - const actionText = data.object_attributes && data.object_attributes.action ? `/${data.object_attributes.action}` : ''; + const action = data.object_attributes && (data.object_attributes.action || data.object_attributes.state); + const actionText = action ? `/${action}` : ''; Log.verbose(`GitLab | ${repo} - ${eventName}${actionText} (${channels.size} channels)`); res.send(`${data.project.path_with_namespace} : Received ${eventName}${actionText}, emitting to ${channels.size} channels...`); const eventResponse = GitlabEventHandler.use(data, event);