Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion actions/setup/js/add_comment.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions actions/setup/js/generate_history_link.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(" "));
Expand Down
15 changes: 0 additions & 15 deletions actions/setup/js/generate_history_link.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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", () => {
Expand Down Expand Up @@ -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", () => {
Expand Down
Loading