ensure tag mode can't work with workflow dispatch and schedule tasks

This commit is contained in:
km-anthropic
2025-07-29 09:38:00 -07:00
parent 96970dfa2d
commit 859e93f18e
3 changed files with 17 additions and 149 deletions

View File

@@ -53,6 +53,17 @@ export const tagMode: Mode = {
}: ModeOptions): Promise<ModeResult> {
// Tag mode handles entity-based events (issues, PRs, comments)
// Validate this mode can handle the event
if (
context.eventName === "workflow_dispatch" ||
context.eventName === "schedule"
) {
throw new Error(
`Tag mode cannot handle ${context.eventName} events. ` +
`Use 'agent' mode for automation events.`,
);
}
// Check if actor is human
await checkHumanActor(octokit.rest, context);