From 85ae69a3ef768525a23e3f95f4d9b04873adbeb4 Mon Sep 17 00:00:00 2001 From: liyitian <2717355959@qq.com> Date: Sun, 14 Dec 2025 20:22:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8autograde=E7=9B=AE=E5=BD=95=E4=B8=8B?= =?UTF-8?q?=E4=B9=9F=E6=B7=BB=E5=8A=A0=E7=A9=BA=E7=9A=84upload=5Fmetadata.?= =?UTF-8?q?py=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autograde/upload_metadata.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 autograde/upload_metadata.py diff --git a/autograde/upload_metadata.py b/autograde/upload_metadata.py new file mode 100644 index 0000000..6ee1813 --- /dev/null +++ b/autograde/upload_metadata.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +""" +空的元数据上传脚本,用于避免工作流因文件不存在而失败 +""" +import sys +import json + +def main(): + print("⚠️ 这是一个空的元数据上传脚本,不会执行任何实际操作") + print("参数:", sys.argv) + # 读取并打印元数据文件内容 + for i, arg in enumerate(sys.argv[1:]): + if arg == "--metadata-file" and i + 2 <= len(sys.argv): + metadata_file = sys.argv[i + 2] + try: + with open(metadata_file, 'r') as f: + metadata = json.load(f) + print(f"元数据文件 {metadata_file} 内容:", json.dumps(metadata, indent=2)) + except Exception as e: + print(f"读取元数据文件失败: {e}") + return 0 + +if __name__ == "__main__": + sys.exit(main()) \ No newline at end of file