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,