Merge pull request #691 from github/copilot/sub-pr-685

Fix path matching in getResourceType to handle relative paths
This commit is contained in:
Aaron Powell
2026-02-10 14:35:50 +11:00
committed by GitHub

View File

@@ -229,9 +229,9 @@ export function getResourceType(filePath: string): string {
if (filePath.endsWith(".agent.md")) return "agent"; if (filePath.endsWith(".agent.md")) return "agent";
if (filePath.endsWith(".prompt.md")) return "prompt"; if (filePath.endsWith(".prompt.md")) return "prompt";
if (filePath.endsWith(".instructions.md")) return "instruction"; if (filePath.endsWith(".instructions.md")) return "instruction";
if (filePath.includes("/skills/") && filePath.endsWith("SKILL.md")) if (/(^|\/)skills\//.test(filePath) && filePath.endsWith("SKILL.md"))
return "skill"; return "skill";
if (filePath.includes("/hooks/") && filePath.endsWith("README.md")) if (/(^|\/)hooks\//.test(filePath) && filePath.endsWith("README.md"))
return "hook"; return "hook";
if (filePath.endsWith(".collection.yml")) return "collection"; if (filePath.endsWith(".collection.yml")) return "collection";
return "unknown"; return "unknown";