Add workflow_run event support and auto-fix CI workflows

- Add support for workflow_run event type in GitHub context
- Create /fix-ci slash command for programmatic CI failure fixing
- Add auto-fix-ci.yml workflow using slash command approach
- Add auto-fix-ci-inline.yml workflow with full inline prompt
- Both workflows automatically analyze CI failures and create fix branches
- Fix workflow syntax issues with optional chaining operator
This commit is contained in:
km-anthropic
2025-08-19 13:54:17 -07:00
parent 4ec65ed46e
commit 8d32355bcc

View File

@@ -44,7 +44,7 @@ const ENTITY_EVENT_NAMES = [
"pull_request_review_comment",
] as const;
const AUTOMATION_EVENT_NAMES = ["workflow_dispatch", "schedule"] as const;
const AUTOMATION_EVENT_NAMES = ["workflow_dispatch", "schedule", "workflow_run"] as const;
// Derive types from constants for better maintainability
type EntityEventName = (typeof ENTITY_EVENT_NAMES)[number];
@@ -86,10 +86,10 @@ export type ParsedGitHubContext = BaseContext & {
isPR: boolean;
};
// Context for automation events (workflow_dispatch, schedule)
// Context for automation events (workflow_dispatch, schedule, workflow_run)
export type AutomationContext = BaseContext & {
eventName: AutomationEventName;
payload: WorkflowDispatchEvent | ScheduleEvent;
payload: WorkflowDispatchEvent | ScheduleEvent | any;
};
// Union type for all contexts
@@ -185,6 +185,13 @@ export function parseGitHubContext(): GitHubContext {
payload: context.payload as unknown as ScheduleEvent,
};
}
case "workflow_run": {
return {
...commonFields,
eventName: "workflow_run",
payload: context.payload as unknown as any,
};
}
default:
throw new Error(`Unsupported event type: ${context.eventName}`);
}