mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
fix: allow direct_prompt with issue assignment without requiring assignee_trigger (#192)
- Modified validation logic to only require assignee_trigger when direct_prompt is not provided - Made assigneeTrigger optional in IssueAssignedEvent type definition - Enhanced context generation to handle missing assigneeTrigger gracefully - Added comprehensive test coverage for the new behavior This enables direct_prompt workflows on issue assignment events without requiring assignee_trigger configuration, fixing the error: "ASSIGNEE_TRIGGER is required for issue assigned event" Fixes #113 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
882586e496
commit
38254908ae
@@ -242,7 +242,7 @@ export function prepareContext(
|
||||
}
|
||||
|
||||
if (eventAction === "assigned") {
|
||||
if (!assigneeTrigger) {
|
||||
if (!assigneeTrigger && !directPrompt) {
|
||||
throw new Error(
|
||||
"ASSIGNEE_TRIGGER is required for issue assigned event",
|
||||
);
|
||||
@@ -254,7 +254,7 @@ export function prepareContext(
|
||||
issueNumber,
|
||||
baseBranch,
|
||||
claudeBranch,
|
||||
assigneeTrigger,
|
||||
...(assigneeTrigger && { assigneeTrigger }),
|
||||
};
|
||||
} else if (eventAction === "opened") {
|
||||
eventData = {
|
||||
@@ -331,7 +331,9 @@ export function getEventTypeAndContext(envVars: PreparedContext): {
|
||||
}
|
||||
return {
|
||||
eventType: "ISSUE_ASSIGNED",
|
||||
triggerContext: `issue assigned to '${eventData.assigneeTrigger}'`,
|
||||
triggerContext: eventData.assigneeTrigger
|
||||
? `issue assigned to '${eventData.assigneeTrigger}'`
|
||||
: `issue assigned event`,
|
||||
};
|
||||
|
||||
case "pull_request":
|
||||
|
||||
@@ -65,7 +65,7 @@ type IssueAssignedEvent = {
|
||||
issueNumber: string;
|
||||
baseBranch: string;
|
||||
claudeBranch: string;
|
||||
assigneeTrigger: string;
|
||||
assigneeTrigger?: string;
|
||||
};
|
||||
|
||||
type PullRequestEvent = {
|
||||
|
||||
Reference in New Issue
Block a user