async function commentIssue()

in index.js [427:446]


async function commentIssue(context, commentText) {
    commentText = commentText && commentText.trim();
    if (!commentText) {
        return;
    }
    try {
        if (await hasCommented(context, commentText)) {
            logger.info('skip current comment as it has been submitted');
            return;
        }
        return await context.octokit.issues.createComment(
            context.issue({
                body: commentText
            })
        );
    } catch (e) {
        logger.error('failed to comment')
        logger.error(e);
    }
}