Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
fix: added check comments lib
Browse files Browse the repository at this point in the history
  • Loading branch information
newnewb authored and z0al committed Jul 8, 2018
1 parent 06f3169 commit e74bec4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/comments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Checks for a previous bot comment, if found returns the commen
*/
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=='testing-bot[bot]'&&comment.user.type=='Bot'){ //looks for the first comment made by the bot
result = comment
break
}
}

return result
}

module.exports = checkComments

0 comments on commit e74bec4

Please sign in to comment.