mirror of
https://github.com/anthropics/claude-plugins-official.git
synced 2026-05-11 14:05:52 -03:00
fix(ci): skip frontmatter validation for files nested inside skill content
The detectFileType function matched any .md file under an agents/ or commands/ directory, including those nested inside skill content (e.g. plugins/foo/skills/bar/agents/). These are reference docs, not plugin agent definitions. Only validate agents/ and commands/ at the plugin root level.
This commit is contained in:
parent
30975e61e3
commit
d7d9ed2006
8
.github/scripts/validate-frontmatter.ts
vendored
8
.github/scripts/validate-frontmatter.ts
vendored
@ -159,10 +159,14 @@ function validateCommand(
|
|||||||
// --- File type detection ---
|
// --- File type detection ---
|
||||||
|
|
||||||
function detectFileType(filePath: string): FileType | null {
|
function detectFileType(filePath: string): FileType | null {
|
||||||
if (filePath.includes("/agents/")) return "agent";
|
// Only match agents/ and commands/ at the plugin root level, not nested
|
||||||
|
// inside skill content (e.g. plugins/foo/skills/bar/agents/ is skill content,
|
||||||
|
// not an agent definition).
|
||||||
|
const inSkillContent = /\/skills\/[^/]+\//.test(filePath);
|
||||||
|
if (filePath.includes("/agents/") && !inSkillContent) return "agent";
|
||||||
if (filePath.includes("/skills/") && basename(filePath) === "SKILL.md")
|
if (filePath.includes("/skills/") && basename(filePath) === "SKILL.md")
|
||||||
return "skill";
|
return "skill";
|
||||||
if (filePath.includes("/commands/")) return "command";
|
if (filePath.includes("/commands/") && !inSkillContent) return "command";
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user