From a07486b29656e4c01390c4a44dde8907310f8a84 Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Tue, 9 Dec 2025 10:59:25 +0000 Subject: [PATCH] Add support for push events in agent mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows the claude-code-action to be used with push events, enabling CI integration testing of skills without requiring manual workflow_dispatch triggers. Changes: - Import PushEvent type from @octokit/webhooks-types - Add "push" to AUTOMATION_EVENT_NAMES - Add PushEvent to AutomationContext payload union - Add case handler for "push" events in parseGitHubContext 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/github/context.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/github/context.ts b/src/github/context.ts index 92f272cb1..4001fda5c 100644 --- a/src/github/context.ts +++ b/src/github/context.ts @@ -7,6 +7,7 @@ import type { PullRequestReviewEvent, PullRequestReviewCommentEvent, WorkflowRunEvent, + PushEvent, } from "@octokit/webhooks-types"; import { CLAUDE_APP_BOT_ID, CLAUDE_BOT_LOGIN } from "./constants"; // Custom types for GitHub Actions events that aren't webhooks @@ -65,6 +66,7 @@ const AUTOMATION_EVENT_NAMES = [ "repository_dispatch", "schedule", "workflow_run", + "push", ] as const; // Derive types from constants for better maintainability @@ -111,14 +113,15 @@ export type ParsedGitHubContext = BaseContext & { isPR: boolean; }; -// Context for automation events (workflow_dispatch, repository_dispatch, schedule, workflow_run) +// Context for automation events (workflow_dispatch, repository_dispatch, schedule, workflow_run, push) export type AutomationContext = BaseContext & { eventName: AutomationEventName; payload: | WorkflowDispatchEvent | RepositoryDispatchEvent | ScheduleEvent - | WorkflowRunEvent; + | WorkflowRunEvent + | PushEvent; }; // Union type for all contexts @@ -233,6 +236,13 @@ export function parseGitHubContext(): GitHubContext { payload: context.payload as unknown as WorkflowRunEvent, }; } + case "push": { + return { + ...commonFields, + eventName: "push", + payload: context.payload as unknown as PushEvent, + }; + } default: throw new Error(`Unsupported event type: ${context.eventName}`); }