Skip to content

Commit 90a3b91

Browse files
authored
Merge remote-tracking branch 'origin/p--fix-gh-list-dir' into copilot/fix-github-actions-workflow-test-failure
Co-authored-by: p- <176818+p-@users.noreply.github.com>
2 parents 7b18236 + 1b14374 commit 90a3b91

3 files changed

Lines changed: 396 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,8 @@ ignore = [
120120
"S101", # Use of assert (standard in pytest)
121121
"SLF001", # Private member accessed (tests legitimately access module internals)
122122
]
123+
124+
[tool.pytest.ini_options]
125+
markers = [
126+
"xdist_group: Group tests to run on the same xdist worker",
127+
]

src/seclab_taskflows/mcp_servers/gh_file_viewer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,13 @@ async def list_directory_from_gh(
283283
r = await call_api(url=f"https://api.github.com/repos/{owner}/{repo}/contents/{path}", params={})
284284
if isinstance(r, str):
285285
return r
286-
if not r.json():
286+
data = r.json()
287+
if not data:
287288
return json.dumps([], indent=2)
289+
if not isinstance(data, list):
290+
return f"Path '{path}' is not a directory."
288291

289-
content = [item["path"] for item in r.json()]
292+
content = [item["path"] for item in data]
290293
return json.dumps(content, indent=2)
291294

292295

0 commit comments

Comments
 (0)