From d573b167d3a26e97ff2e584019ab0c2a3ba6f8b0 Mon Sep 17 00:00:00 2001 From: Takaki Sato <96252494+takakisatojp@users.noreply.github.com> Date: Fri, 7 Aug 2026 23:55:20 +0900 Subject: [PATCH] fix: support labeled action for pull_request events in track_progress (#1586) Adds "labeled" to the valid pull_request actions for track_progress, mirroring the existing support for issue events. Previously, adding a label to a PR (e.g. to trigger a label-driven Claude review) would fail validation even though the same pattern works for issues. Fixes #1585 --- action.yml | 2 +- src/modes/detector.ts | 1 + test/modes/detector.test.ts | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f48353f0..f72e9877 100644 --- a/action.yml +++ b/action.yml @@ -134,7 +134,7 @@ inputs: required: false default: "claude[bot]" track_progress: - description: "Force tag mode with tracking comments for pull_request and issue events. Only applicable to pull_request (opened, synchronize, ready_for_review, reopened) and issue (opened, edited, labeled, assigned) events." + description: "Force tag mode with tracking comments for pull_request and issue events. Only applicable to pull_request (opened, synchronize, ready_for_review, reopened, labeled) and issue (opened, edited, labeled, assigned) events." required: false default: "false" include_fix_links: diff --git a/src/modes/detector.ts b/src/modes/detector.ts index c15ce88a..46e13665 100644 --- a/src/modes/detector.ts +++ b/src/modes/detector.ts @@ -103,6 +103,7 @@ function validateTrackProgressEvent(context: GitHubContext): void { "synchronize", "ready_for_review", "reopened", + "labeled", ]; if (!validActions.includes(context.eventAction)) { throw new Error( diff --git a/test/modes/detector.test.ts b/test/modes/detector.test.ts index 3b58f9e9..6c249745 100644 --- a/test/modes/detector.test.ts +++ b/test/modes/detector.test.ts @@ -76,6 +76,20 @@ describe("detectMode with enhanced routing", () => { expect(detectMode(context)).toBe("agent"); }); + it("should use tag mode when track_progress is true for pull_request.labeled", () => { + const context: GitHubContext = { + ...baseContext, + eventName: "pull_request", + eventAction: "labeled", + payload: { pull_request: { number: 1 } } as any, + entityNumber: 1, + isPR: true, + inputs: { ...baseContext.inputs, trackProgress: true }, + }; + + expect(detectMode(context)).toBe("tag"); + }); + it("should throw error when track_progress is used with unsupported PR action", () => { const context: GitHubContext = { ...baseContext,