ci: 更新 .gitlab-ci.yml 和 update_files.py

- 移除了 .gitlab-ci.yml 中的安全扫描配置
- 调整了 CI/CD 流水线的阶段
- 优化了 update_files.py 脚本的输出信息
- 添加了脚本执行开始的提示信息
- 修改了没有更新文件时的提示信息
This commit is contained in:
2025-03-31 23:07:22 +08:00
parent 2c96692cb9
commit 189dd4bf5d
2 changed files with 10 additions and 15 deletions

View File

@@ -1,9 +1,11 @@
#!/usr/bin/env python
import os
import yaml
import subprocess
import sys
import yaml
def download_file(url):
"""使用 curl 下载文件内容"""
result = subprocess.run(["curl", "-s", url], capture_output=True, text=True)
@@ -12,15 +14,17 @@ def download_file(url):
return None
return result.stdout
def main():
# 读取 list.yaml
try:
with open("list.yaml", "r", encoding="utf-8") as f:
items = yaml.safe_load(f)
except FileNotFoundError:
print("list.yaml 文件不存在。")
print("list.yaml 文件不存在。")
sys.exit(0)
print("🚀 开始更新文件")
modified = False
for item in items:
@@ -72,7 +76,8 @@ def main():
subprocess.run(["git", "commit", "-m", commit_message], check=False)
subprocess.run(["git", "push", "origin", "main"], check=True)
else:
print("没有需要更新的文件。")
print("📦 没有需要更新的文件。")
if __name__ == "__main__":
main()