mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-24 15:34:13 +08:00
simplify: remove workflow_dispatch/schedule from create-prompt
- Remove workflow_dispatch and schedule event handling from create-prompt since agent mode doesn't use the standard prompt generation flow - Enforce mode compatibility at selection time in the registry instead of runtime validation in tag mode - Add explanatory comment in agent mode about why prompt file is needed - Update tests to reflect simplified event handling This reduces code duplication and makes the separation between tag mode (entity-based events) and agent mode (automation events) clearer.
This commit is contained in:
@@ -350,24 +350,6 @@ export function prepareContext(
|
||||
};
|
||||
break;
|
||||
|
||||
case "workflow_dispatch":
|
||||
eventData = {
|
||||
eventName: "workflow_dispatch",
|
||||
isPR: false,
|
||||
...(baseBranch && { baseBranch }),
|
||||
...(claudeBranch && { claudeBranch }),
|
||||
};
|
||||
break;
|
||||
|
||||
case "schedule":
|
||||
eventData = {
|
||||
eventName: "schedule",
|
||||
isPR: false,
|
||||
...(baseBranch && { baseBranch }),
|
||||
...(claudeBranch && { claudeBranch }),
|
||||
};
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error(`Unsupported event type: ${eventName}`);
|
||||
}
|
||||
@@ -430,18 +412,6 @@ export function getEventTypeAndContext(envVars: PreparedContext): {
|
||||
: `pull request event`,
|
||||
};
|
||||
|
||||
case "workflow_dispatch":
|
||||
return {
|
||||
eventType: "WORKFLOW_DISPATCH",
|
||||
triggerContext: `workflow dispatch event`,
|
||||
};
|
||||
|
||||
case "schedule":
|
||||
return {
|
||||
eventType: "SCHEDULE",
|
||||
triggerContext: `scheduled automation event`,
|
||||
};
|
||||
|
||||
default:
|
||||
throw new Error(`Unexpected event type`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user