From 23f78f28d35d2c9a142ae4018fed8d271aceac59 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 22:30:24 +0000 Subject: [PATCH 1/2] Initial plan From 0ae9375ca5831f40f04dfd80d5351ca6d3b53a54 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 22:35:28 +0000 Subject: [PATCH 2/2] fix(USE-003): add staged mode preview summary to upload_artifact handler Agent-Logs-Url: https://github.com/github/gh-aw/sessions/5071a796-e5fb-424b-be5e-d4eaba2bc180 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/upload_artifact.cjs | 15 ++++++++++++++- actions/setup/js/upload_artifact.test.cjs | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/actions/setup/js/upload_artifact.cjs b/actions/setup/js/upload_artifact.cjs index a92d14794da..f387e226337 100644 --- a/actions/setup/js/upload_artifact.cjs +++ b/actions/setup/js/upload_artifact.cjs @@ -565,7 +565,20 @@ async function main(config = {}) { }; } } else { - core.info(`Staged mode: skipping artifact upload for slot ${i}`); + // Emit a staged mode preview summary. + let summaryContent = "## 🎭 Staged Mode: Upload Artifact Preview\n\n"; + summaryContent += "The following artifact upload would be performed if staged mode was disabled:\n\n"; + summaryContent += `**Artifact Name:** ${artifactName}\n\n`; + summaryContent += `**Files (${files.length}):**\n\n`; + for (const file of files) { + summaryContent += `- \`${file}\`\n`; + } + summaryContent += `\n**Total Size:** ${totalSize} bytes\n\n`; + summaryContent += `**Retention:** ${retentionDays} days\n\n`; + summaryContent += `> â„šī¸ Upload skipped (staged mode active)\n\n`; + + await core.summary.addRaw(summaryContent).write(); + core.info("📝 Upload artifact preview written to step summary"); } // Set step outputs so downstream jobs can reference the tmp ID. diff --git a/actions/setup/js/upload_artifact.test.cjs b/actions/setup/js/upload_artifact.test.cjs index 88dd7cf5cb1..d260f0515f1 100644 --- a/actions/setup/js/upload_artifact.test.cjs +++ b/actions/setup/js/upload_artifact.test.cjs @@ -398,6 +398,20 @@ describe("upload_artifact.cjs", () => { expect(results[0].success).toBe(true); expect(mockArtifactClient.uploadArtifact).not.toHaveBeenCalled(); }); + + it("emits a staged mode preview summary when staged mode is active", async () => { + process.env.GH_AW_SAFE_OUTPUTS_STAGED = "true"; + writeStaging("output.json"); + + await runHandler(buildConfig(), [{ type: "upload_artifact", path: "output.json" }]); + + expect(mockCore.summary.addRaw).toHaveBeenCalled(); + const summaryContent = mockCore.summary.addRaw.mock.calls[0][0]; + expect(summaryContent).toContain("🎭 Staged Mode"); + expect(summaryContent).toContain("Upload Artifact Preview"); + expect(summaryContent).toContain("output.json"); + expect(mockCore.summary.write).toHaveBeenCalled(); + }); }); describe("resolver file", () => {