#!/bin/bash
WORKSPACE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../" && pwd)"
cd "$WORKSPACE_DIR"
# 拉取最新代码
git pull origin main || true
# 提交所有变更
git add .
git commit -m "auto backup $(date +'%Y-%m-%d %H:%M:%S')" || true
# 推送到远程仓库
git push origin main || true
echo "✅ 备份完成：$(date)"
