From 9c8ca262b613d50096b677f786616d492d0350f7 Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Tue, 29 Jul 2025 13:21:58 -0700 Subject: [PATCH] More robust type checking --- src/github/context.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/github/context.ts b/src/github/context.ts index de04acb..8f0ad81 100644 --- a/src/github/context.ts +++ b/src/github/context.ts @@ -265,7 +265,13 @@ export function isIssuesAssignedEvent( export function isEntityContext( context: GitHubContext, ): context is ParsedGitHubContext { - return "entityNumber" in context && "isPR" in context; + return ( + context.eventName === "issues" || + context.eventName === "issue_comment" || + context.eventName === "pull_request" || + context.eventName === "pull_request_review" || + context.eventName === "pull_request_review_comment" + ); } // Type guard to check if context is an automation context