From 72eb485a1bbd9146d9a12dd712d236e9dda6292d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 13:22:46 +0000 Subject: [PATCH 1/2] fix: add generated footer to close_issue comment body Issue comments posted when auto-closing via safe-outputs now include the generated workflow footer (run URL, workflow name) just like other safe-output message types (close-pull-request, add-comment, etc.). Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/close_issue.cjs | 7 ++++--- actions/setup/js/close_issue.test.cjs | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/actions/setup/js/close_issue.cjs b/actions/setup/js/close_issue.cjs index 2437f43024d..57d7ab1bdb9 100644 --- a/actions/setup/js/close_issue.cjs +++ b/actions/setup/js/close_issue.cjs @@ -8,7 +8,7 @@ const { resolveTargetRepoConfig, resolveAndValidateRepo, validateRepo } = require("./repo_helpers.cjs"); const { createAuthenticatedGitHubClient } = require("./handler_auth.cjs"); const { ERR_NOT_FOUND } = require("./error_codes.cjs"); -const { createCloseEntityHandler, ISSUE_CONFIG } = require("./close_entity_helpers.cjs"); +const { createCloseEntityHandler, buildCommentBody, ISSUE_CONFIG } = require("./close_entity_helpers.cjs"); const { loadTemporaryIdMapFromResolved, resolveRepoIssueTarget } = require("./temporary_id.cjs"); const { getErrorMessage } = require("./error_helpers.cjs"); const { normalizeIssueIntentMetadata } = require("./issue_intents.cjs"); @@ -297,8 +297,9 @@ async function main(config = {}) { }, buildCommentBody(sanitizedBody) { - // Issues post the sanitized body directly without a workflow footer - return sanitizedBody; + const triggeringIssueNumber = context.payload?.issue?.number; + const triggeringPRNumber = context.payload?.pull_request?.number; + return buildCommentBody(sanitizedBody, triggeringIssueNumber, triggeringPRNumber); }, addComment: addIssueComment, diff --git a/actions/setup/js/close_issue.test.cjs b/actions/setup/js/close_issue.test.cjs index f58a173a2d2..54940e0137d 100644 --- a/actions/setup/js/close_issue.test.cjs +++ b/actions/setup/js/close_issue.test.cjs @@ -413,7 +413,7 @@ describe("close_issue", () => { expect(result.success).toBe(true); expect(commentCalls.length).toBe(1); // Should use the body from message, not the config comment - expect(commentCalls[0].body).toBe("Custom body from message"); + expect(commentCalls[0].body).toContain("Custom body from message"); expect(commentCalls[0].body).not.toContain("Default comment from config"); }); @@ -506,7 +506,7 @@ describe("close_issue", () => { expect(result.success).toBe(true); expect(result.alreadyClosed).toBe(true); - expect(commentBody).toBe("Closing comment with details"); + expect(commentBody).toContain("Closing comment with details"); expect(issueUpdateCalled).toBe(false); // Should not call update for already closed issue }); From 112ee4400bafee393288d24cad963a6266d92eb5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 14:27:19 +0000 Subject: [PATCH 2/2] test: assert close_issue footer markers in close_issue regression tests Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> --- actions/setup/js/close_issue.test.cjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/actions/setup/js/close_issue.test.cjs b/actions/setup/js/close_issue.test.cjs index 54940e0137d..b31405ce66c 100644 --- a/actions/setup/js/close_issue.test.cjs +++ b/actions/setup/js/close_issue.test.cjs @@ -383,6 +383,8 @@ describe("close_issue", () => { expect(result.success).toBe(true); expect(commentCalls.length).toBe(1); expect(commentCalls[0].body).toContain("This issue is being closed automatically"); + expect(commentCalls[0].body).toContain("for #123"); + expect(commentCalls[0].body).toContain("gh-aw-agentic-workflow:"); }); it("should use body field from message over config comment", async () => { @@ -414,6 +416,8 @@ describe("close_issue", () => { expect(commentCalls.length).toBe(1); // Should use the body from message, not the config comment expect(commentCalls[0].body).toContain("Custom body from message"); + expect(commentCalls[0].body).toContain("for #123"); + expect(commentCalls[0].body).toContain("gh-aw-agentic-workflow:"); expect(commentCalls[0].body).not.toContain("Default comment from config"); });