Skip to content

Instantly share code, notes, and snippets.

@bkeepers
Created September 14, 2017 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkeepers/5f2545263e342575ac55741fa8414246 to your computer and use it in GitHub Desktop.
Save bkeepers/5f2545263e342575ac55741fa8414246 to your computer and use it in GitHub Desktop.
Probot app to delete 👍 and single emoji comments.
// :+1: comments and single emoji
const pattern = /^\W*(:[\w-\+]+:|[\uE000-\uF8FF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF])\W*$/g;
module.exports = robot => {
robot.on('issue_comment.created', context => {
if(context.payload.comment.body.match(pattern)) {
context.github.issues.deleteComment(context.issue());
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment