diff --git a/actions/setup/js/add_comment.cjs b/actions/setup/js/add_comment.cjs index cdfe329b42..9d6acfce49 100644 --- a/actions/setup/js/add_comment.cjs +++ b/actions/setup/js/add_comment.cjs @@ -528,7 +528,7 @@ async function main(config = {}) { const triggeringPRNumber = context.payload.pull_request?.number; const triggeringDiscussionNumber = context.payload.discussion?.number; - // Generate history URL using in:comments, with type= based on execution context + // Generate history URL with type= based on execution context const historyUrl = generateHistoryUrl({ owner: repoParts.owner, diff --git a/actions/setup/js/generate_history_link.cjs b/actions/setup/js/generate_history_link.cjs index 21fbf75662..cccc5f09b1 100644 --- a/actions/setup/js/generate_history_link.cjs +++ b/actions/setup/js/generate_history_link.cjs @@ -58,11 +58,7 @@ function generateHistoryUrl({ owner, repo, itemType, workflowCallId, workflowId, queryParts.push("is:pr"); } - // Search for the XML marker in the appropriate field - // Comments (issue/PR or discussion) use in:comments; all others use in:body - const isComment = itemType === "comment" || itemType === "discussion_comment"; queryParts.push(`"${markerId}"`); - queryParts.push(isComment ? "in:comments" : "in:body"); const url = new URL(`${server}/search`); url.searchParams.set("q", queryParts.join(" ")); diff --git a/actions/setup/js/generate_history_link.test.cjs b/actions/setup/js/generate_history_link.test.cjs index 0bd7ef08da..c0eae514fa 100644 --- a/actions/setup/js/generate_history_link.test.cjs +++ b/actions/setup/js/generate_history_link.test.cjs @@ -85,7 +85,6 @@ describe("generate_history_link.cjs", () => { expect(url).not.toContain("is%3A"); expect(url).toContain("type=discussions"); - expect(url).toContain("in%3Acomments"); }); }); @@ -193,18 +192,6 @@ describe("generate_history_link.cjs", () => { expect(url).toContain("gh-aw-workflow-id%3A+my-workflow"); }); - it("should include in:body qualifier in search query", () => { - const url = generateHistoryUrl({ - owner: "testowner", - repo: "testrepo", - itemType: "issue", - workflowId: "my-workflow", - serverUrl: "https://github.com", - }); - - expect(url).toContain("in%3Abody"); - }); - it("should NOT include open/closed state filter", () => { const url = generateHistoryUrl({ owner: "testowner", @@ -330,7 +317,6 @@ describe("generate_history_link.cjs", () => { expect(query).toContain("repo:myowner/myrepo"); expect(query).toContain("is:issue"); expect(query).toContain('"gh-aw-workflow-id: my-workflow"'); - expect(query).toContain("in:body"); }); it("should generate a complete pull_request search URL", () => { @@ -384,7 +370,6 @@ describe("generate_history_link.cjs", () => { expect(query).not.toContain("is:issue"); expect(query).not.toContain("is:pr"); expect(query).toContain('"gh-aw-workflow-id: my-workflow"'); - expect(query).toContain("in:comments"); }); it("should generate correct URL with workflowCallId", () => {