MCPcopy Create free account
hub / github.com/DSGWJQ/Feagent / main

Function main

scripts/git_push.py:19–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18
19def main():
20 # 1. 检查状态
21 print("=" * 60)
22 print("1. 检查 Git 状态")
23 print("=" * 60)
24 run_command(["git", "status", "--short"])
25
26 # 2. 添加所有更改
27 print("\n" + "=" * 60)
28 print("2. 添加所有更改")
29 print("=" * 60)
30 run_command(["git", "add", "-A"])
31
32 # 3. 再次检查状态
33 print("\n" + "=" * 60)
34 print("3. 再次检查状态")
35 print("=" * 60)
36 run_command(["git", "status", "--short"])
37
38 # 4. 提交
39 print("\n" + "=" * 60)
40 print("4. 提交更改")
41 print("=" * 60)
42 commit_msg = """feat: 添加数据库迁移和应用启动功能
43
44- 创建环境配置文件 (.env)
45- 添加数据库迁移测试 (11个测试用例)
46- 成功运行数据库迁移 (agents, runs, tasks表)
47- 添加应用启动测试 (10个测试用例)
48- 启动FastAPI应用服务器
49- 所有99个测试通过,代码覆盖率89%
50- 修复CORS_ORIGINS环境变量格式问题"""
51
52 returncode = run_command(["git", "commit", "-m", commit_msg])
53 if returncode != 0:
54 print("提交失败或没有更改需要提交")
55
56 # 5. 推送到远程
57 print("\n" + "=" * 60)
58 print("5. 推送到 GitHub")
59 print("=" * 60)
60 returncode = run_command(["git", "push", "origin", "main"])
61 if returncode == 0:
62 print("\n✅ 成功推送到 GitHub!")
63 else:
64 print("\n❌ 推送失败,请检查错误信息")
65 return 1
66
67 return 0
68
69
70if __name__ == "__main__":

Callers 1

git_push.pyFile · 0.70

Calls 1

run_commandFunction · 0.85

Tested by

no test coverage detected