More robust type checking

This commit is contained in:
km-anthropic
2025-07-29 13:21:58 -07:00
parent 21680fe730
commit 9c8ca262b6

View File

@@ -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