This commit is contained in:
@@ -10,7 +10,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
# 每天凌晨1点执行
|
# 每天凌晨1点执行
|
||||||
- cron: '0 1 * * *'
|
- cron: '0 1 * * 0'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CONFIG_FILE: 'repos.yaml'
|
CONFIG_FILE: 'repos.yaml'
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ def sync_repository(repo_config):
|
|||||||
print(f"\n[1/6] 克隆目标仓库...")
|
print(f"\n[1/6] 克隆目标仓库...")
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
['git', 'clone', target_url, work_dir],
|
['git', 'clone', target_url, work_dir],
|
||||||
capture_output=True, text=True, timeout=300
|
capture_output=True, text=True, timeout=3600
|
||||||
)
|
)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
print(f"❌ 克隆目标仓库失败:")
|
print(f"❌ 克隆目标仓库失败:")
|
||||||
@@ -112,7 +112,7 @@ def sync_repository(repo_config):
|
|||||||
try:
|
try:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
['git', 'fetch', 'upstream'],
|
['git', 'fetch', 'upstream'],
|
||||||
capture_output=True, text=True, timeout=200
|
capture_output=True, text=True, timeout=3600
|
||||||
)
|
)
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
break
|
break
|
||||||
@@ -166,7 +166,7 @@ def sync_repository(repo_config):
|
|||||||
print(f"[6/6] 推送到目标仓库...")
|
print(f"[6/6] 推送到目标仓库...")
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
['git', 'push', '--force', '--tags', 'origin', f'refs/heads/{branch}'],
|
['git', 'push', '--force', '--tags', 'origin', f'refs/heads/{branch}'],
|
||||||
capture_output=True, text=True, timeout=600
|
capture_output=True, text=True, timeout=3600
|
||||||
)
|
)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
print(f"❌ 推送到目标仓库失败:")
|
print(f"❌ 推送到目标仓库失败:")
|
||||||
|
|||||||
Reference in New Issue
Block a user