fix validate

This commit is contained in:
起个名字好难的喵
2025-07-25 19:45:45 +08:00
parent 9d35cebad5
commit 523fb15b52
80 changed files with 1886 additions and 1886 deletions

View File

@@ -221,9 +221,9 @@ def ensure_required_fields(info, filename):
info["type"] = "collect"
corrections.append("type 自动修正为 collect")
if not info["author"]:
info["author"] = os.getenv("GITHUB_ACTOR", "未知作者")
corrections.append(f"author 自动设置为 {info['author']}")
if not info["authors"]:
info["authors"] = os.getenv("GITHUB_ACTOR", "未知作者")
corrections.append(f"author 自动设置为 {info['authors']}")
return corrections
@@ -434,9 +434,9 @@ def initialize_data(data, file_path):
info["type"] = "collect"
messages.append(f"⚠️ 文件缺少 type 字段,已设置为默认值: collect")
if "author" not in info:
info["author"] = os.getenv("GITHUB_ACTOR", "未知作者")
messages.append(f"⚠️ 文件缺少 author 字段,已设置为: {info['author']}")
if "authors" not in info:
info["authors"] = os.getenv("GITHUB_ACTOR", "未知作者")
messages.append(f"⚠️ 文件缺少 author 字段,已设置为: {info['authors']}")
if "version" not in info:
info["version"] = DEFAULT_VERSION