From cd0901c81e1c34388ec07986a5ec2b10fef28b51 Mon Sep 17 00:00:00 2001 From: rogeriopvl Date: Wed, 3 May 2017 16:30:24 +0100 Subject: [PATCH] feat: add different text when no PRs need review Currently when no pull requests were needing review, the message would show the same header, mentioning that there are pull requests to be reviewed, followed by an empy list. This commit fixes that and adds its own message stating that there are no pull requests waiting for review. --- lib/server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/server.js b/lib/server.js index 4c213b3..7479603 100644 --- a/lib/server.js +++ b/lib/server.js @@ -62,6 +62,12 @@ module.exports = function server () { } function buildMessage (data) { + if (data.length < 1) { + return Promise.resolve( + ':oncoming_police_car: No pull requests are waiting for review! :tada:' + ) + } + const headers = [ ':police_car: The following pull requests are waiting for a review:', '\n'