Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Prevent pr comments from recursively triggering runs

Tomas Valenta766e0d60baa7
diff --git a/github/webhooks.ts b/github/webhooks.ts
index f1f732317..47fa8b5f8 100644
--- a/github/webhooks.ts
+++ b/github/webhooks.ts
@@ -85,10 +85,14 @@ function getPRNumber(pr_url?: string) {
}
}
-
const issueCommentHandler: HandlerFunction<'issue_comment', unknown> = async (event) => {
const { payload } = event
+ if (payload.comment.user.type === 'Bot') {
+ console.log('Comment was made by a GitHub bot, ignoring')
+ return
+ }
+
const installationID = payload.installation?.id
const repositoryID = payload.repository.id
const { owner, repo } = parseRepoName(payload.repository.full_name)