diff --git a/actions/setup/js/display_file_helpers.cjs b/actions/setup/js/display_file_helpers.cjs index 01d5395a8f..d9af970c2e 100644 --- a/actions/setup/js/display_file_helpers.cjs +++ b/actions/setup/js/display_file_helpers.cjs @@ -116,7 +116,30 @@ function displayDirectories(directories, maxBytes = 64 * 1024) { core.startGroup("=== Listing All Gateway-Related Files ==="); for (const dir of directories) { - displayDirectory(dir, maxBytes); + // Display directory header without creating a nested group + core.info(`📁 Directory: ${dir}`); + + try { + if (!fs.existsSync(dir)) { + core.notice(` Directory does not exist: ${dir}`); + continue; + } + + const files = fs.readdirSync(dir); + if (files.length === 0) { + core.info(" (empty directory)"); + continue; + } + + // Display each file + for (const file of files) { + const filePath = `${dir}/${file}`; + displayFileContent(filePath, file, maxBytes); + } + } catch (/** @type {unknown} */ error) { + const errorMessage = error instanceof Error ? error.message : String(error); + core.error(` Error reading directory ${dir}: ${errorMessage}`); + } } core.endGroup(); diff --git a/actions/setup/js/display_file_helpers.test.cjs b/actions/setup/js/display_file_helpers.test.cjs index 683399b4f5..c9fc703709 100644 --- a/actions/setup/js/display_file_helpers.test.cjs +++ b/actions/setup/js/display_file_helpers.test.cjs @@ -439,10 +439,10 @@ describe("display_file_helpers", () => { // Check outer group was started expect(mockCore.startGroup).toHaveBeenCalledWith("=== Listing All Gateway-Related Files ==="); - // Check both directories were displayed - const startGroupCalls = mockCore.startGroup.mock.calls.map(call => call[0]); - expect(startGroupCalls.some(call => call.includes(tmpDir1))).toBe(true); - expect(startGroupCalls.some(call => call.includes(tmpDir2))).toBe(true); + // Check both directories were displayed in info messages (not as separate groups) + const infoMessages = mockCore.info.mock.calls.map(call => call[0]).join("\n"); + expect(infoMessages).toContain(`📁 Directory: ${tmpDir1}`); + expect(infoMessages).toContain(`📁 Directory: ${tmpDir2}`); } finally { delete global.core; fs.rmSync(tmpDir1, { recursive: true, force: true }); diff --git a/actions/setup/js/parse_mcp_gateway_log.test.cjs b/actions/setup/js/parse_mcp_gateway_log.test.cjs index 0e7f930482..54f2415b5a 100644 --- a/actions/setup/js/parse_mcp_gateway_log.test.cjs +++ b/actions/setup/js/parse_mcp_gateway_log.test.cjs @@ -387,8 +387,8 @@ Some content here.`; // Check header group was started expect(allGroups).toContain("=== Listing All Gateway-Related Files ==="); - // Check directories are listed - expect(allGroups).toContain("/tmp/gh-aw/mcp-logs"); + // Check directories are listed in info messages (not as separate groups) + expect(allOutput).toContain("📁 Directory: /tmp/gh-aw/mcp-logs"); // Check files are listed expect(allOutput).toContain("gateway.log");