fix: 修复 issue-template 测试误删 .github/workflows 目录

afterEach 清理时 rmSync 误删了整个 .github/ 目录(含 workflows),
改为只删测试创建的 ISSUE_TEMPLATE 子目录。

Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
This commit is contained in:
claude-code-best
2026-05-10 21:11:50 +08:00
parent ea5df0ab60
commit 89800137b6

View File

@@ -202,9 +202,9 @@ function createTemplateInCwd(files: Record<string, string>): string {
for (const [name, content] of Object.entries(files)) {
writeFileSync(join(templateDir, name), content)
}
// Track the .github dir for cleanup (remove whole .github if it didn't exist)
const githubDir = join(realCwd, '.github')
createdTemplatePath = githubDir
// Track the ISSUE_TEMPLATE dir for cleanup — never delete the whole .github/
// as it may contain workflows, settings, or other project config.
createdTemplatePath = templateDir
return templateDir
}