From c44093c517c0288616b88860733d20c7cd62b37d Mon Sep 17 00:00:00 2001 From: newnewb Date: Sat, 28 Apr 2018 04:10:21 +0400 Subject: [PATCH] fix: enabled naming the app via env variable --- lib/comments.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/comments.js b/lib/comments.js index 9db0d65..5b6b48c 100644 --- a/lib/comments.js +++ b/lib/comments.js @@ -3,16 +3,7 @@ */ async function checkComments(issues,pull){ const comments = await issues.getComments(pull) - let result -//iterates over all the comments - for (comment of comments['data']){ - if(comment.user.login=='commitlint[bot]'&&comment.user.type=='Bot'){ //looks for the first comment made by the bot - result = comment - break - } - } - - return result + return comment = comments.data.find(comment => comment.user.login === process.env.APP_NAME + '[bot]') } module.exports = checkComments \ No newline at end of file