diff --git a/src/index.mjs b/src/index.mjs index bec70c6..1b78af5 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -31,11 +31,16 @@ async function ghActionBot() { const comments = (await getComments(repo, { body: new RegExp(COMMENT_BODY_REGEXP, COMMENT_BODY_REGEXP_FLAGS), actor: COMMENT_ACTOR, - })).filter(comment => !history.get(comment.id)); + })).filter(comment => !history.get(comment.id)); // skip comments already processed + + if (comments.length) logger.debug(`Found ${comments.length} comments to process`); // read pull data const pulls = (await Promise.all( comments.map(async comment => { + // keep track of comments that have been processed + history.add(comment); + const pull = await getPull(repo, comment.number); if (pull.state !== 'open') {