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
This commit is contained in:
Takaki Sato
2026-08-07 07:55:20 -07:00
committed by GitHub
parent 0a5f191964
commit d573b167d3
3 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -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:
+1
View File
@@ -103,6 +103,7 @@ function validateTrackProgressEvent(context: GitHubContext): void {
"synchronize",
"ready_for_review",
"reopened",
"labeled",
];
if (!validActions.includes(context.eventAction)) {
throw new Error(
+14
View File
@@ -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,