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

Commit e74bec4

Browse files
newnewbz0al
authored andcommitted
fix: added check comments lib
1 parent 06f3169 commit e74bec4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/comments.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Checks for a previous bot comment, if found returns the commen
3+
*/
4+
async function checkComments(issues,pull){
5+
const comments = await issues.getComments(pull)
6+
let result
7+
//iterates over all the comments
8+
for (comment of comments['data']){
9+
if(comment.user.login=='testing-bot[bot]'&&comment.user.type=='Bot'){ //looks for the first comment made by the bot
10+
result = comment
11+
break
12+
}
13+
}
14+
15+
return result
16+
}
17+
18+
module.exports = checkComments

0 commit comments

Comments
 (0)