Github bots are basically bots that augment the software development process on Github. GitHub Apps can listen to webhook events sent by a repository or organization. Bot uses its internal event emitter to perform actions based on those events.
A github-bot App might look like this:
module.exports = (app) => {
app.on("issues.opened", async (context) => {
const issueComment = context.issue({
body: "Thanks for opening this issue!",
});
return context.octokit.issues.createComment(issueComment);
});
app.onAny(async (context) => {
context.log.info({ event: context.name, action: context.payload.action });
});
app.onError(async (error) => {
context.log.error(error);
});
};