mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
fix: correct assignee trigger test to handle different assignee properly (#178)
* fix: use direct assignee field * fix: correct assignee trigger test to handle different assignee properly The test was failing because the mockIssueAssignedContext was missing the top-level assignee field that the trigger validation logic checks. Added the missing assignee field to the mock context and updated the test to properly override both the top-level assignee and issue.assignee fields when testing assignment to a different user. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Adjust IssuesAssignedEvent import position (#2) --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as github from "@actions/github";
|
||||
import type {
|
||||
IssuesEvent,
|
||||
IssuesAssignedEvent,
|
||||
IssueCommentEvent,
|
||||
PullRequestEvent,
|
||||
PullRequestReviewEvent,
|
||||
@@ -147,3 +148,9 @@ export function isPullRequestReviewCommentEvent(
|
||||
): context is ParsedGitHubContext & { payload: PullRequestReviewCommentEvent } {
|
||||
return context.eventName === "pull_request_review_comment";
|
||||
}
|
||||
|
||||
export function isIssuesAssignedEvent(
|
||||
context: ParsedGitHubContext,
|
||||
): context is ParsedGitHubContext & { payload: IssuesAssignedEvent } {
|
||||
return isIssuesEvent(context) && context.eventAction === "assigned";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user