mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
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:
@@ -44,7 +44,7 @@ const ENTITY_EVENT_NAMES = [
|
|||||||
"pull_request_review_comment",
|
"pull_request_review_comment",
|
||||||
] as const;
|
] 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
|
// Derive types from constants for better maintainability
|
||||||
type EntityEventName = (typeof ENTITY_EVENT_NAMES)[number];
|
type EntityEventName = (typeof ENTITY_EVENT_NAMES)[number];
|
||||||
@@ -86,10 +86,10 @@ export type ParsedGitHubContext = BaseContext & {
|
|||||||
isPR: boolean;
|
isPR: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Context for automation events (workflow_dispatch, schedule)
|
// Context for automation events (workflow_dispatch, schedule, workflow_run)
|
||||||
export type AutomationContext = BaseContext & {
|
export type AutomationContext = BaseContext & {
|
||||||
eventName: AutomationEventName;
|
eventName: AutomationEventName;
|
||||||
payload: WorkflowDispatchEvent | ScheduleEvent;
|
payload: WorkflowDispatchEvent | ScheduleEvent | any;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Union type for all contexts
|
// Union type for all contexts
|
||||||
@@ -185,6 +185,13 @@ export function parseGitHubContext(): GitHubContext {
|
|||||||
payload: context.payload as unknown as ScheduleEvent,
|
payload: context.payload as unknown as ScheduleEvent,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
case "workflow_run": {
|
||||||
|
return {
|
||||||
|
...commonFields,
|
||||||
|
eventName: "workflow_run",
|
||||||
|
payload: context.payload as unknown as any,
|
||||||
|
};
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported event type: ${context.eventName}`);
|
throw new Error(`Unsupported event type: ${context.eventName}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user