mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
More robust type checking
This commit is contained in:
@@ -265,7 +265,13 @@ export function isIssuesAssignedEvent(
|
|||||||
export function isEntityContext(
|
export function isEntityContext(
|
||||||
context: GitHubContext,
|
context: GitHubContext,
|
||||||
): context is ParsedGitHubContext {
|
): 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
|
// Type guard to check if context is an automation context
|
||||||
|
|||||||
Reference in New Issue
Block a user