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:
Kuma Taro
2025-06-18 02:06:06 +09:00
committed by GitHub
parent bcf2fe94f8
commit 13ccdab2f8
4 changed files with 21 additions and 2 deletions

View File

@@ -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";
}