From a7f6a028a6171210d32b8fec630e5a8551abbc64 Mon Sep 17 00:00:00 2001 From: Antoine Date: Mon, 4 Sep 2017 10:50:23 +0200 Subject: [PATCH] Fix displayed action --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 7056af1..2de10bd 100644 --- a/index.js +++ b/index.js @@ -127,8 +127,14 @@ var handlers = { if (issue.action === 'update') return; + // Make action displayable : + // open -> opened + // close -> closed + // merge -> merged + var displayedAction = issue.action.substr(-1) === 'e' ? issue.action + 'd' : issue.action + 'ed'; + shortenURL(url, function(shortUrl) { - var msg = user + ' ' + issue.action + 'd issue #' + issueNumber + ' ("' + issueTitle + '") on ' + projectName + ' ' + shortUrl; + var msg = user + ' ' + displayedAction ' issue #' + issueNumber + ' ("' + issueTitle + '") on ' + projectName + ' ' + shortUrl; say(msg); }); },