Skip to content
Closed
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
25 changes: 24 additions & 1 deletion actions/setup/js/display_file_helpers.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions actions/setup/js/display_file_helpers.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
4 changes: 2 additions & 2 deletions actions/setup/js/parse_mcp_gateway_log.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down