This commit is contained in:
autoactions 2024-12-23 09:55:39 +08:00
parent 48a4e5315e
commit acc6040237

View File

@ -50,11 +50,18 @@ jobs:
exit 0
fi
# 重置到上游状态
git reset --hard upstream/main
# 尝试合并上游更新
if ! git merge upstream/main --no-edit; then
echo "合并失败,存在冲突"
# 中止合并
git merge --abort
echo "sync_status=conflict" >> $GITHUB_OUTPUT
exit 1
fi
# 推送合并后的更新到原分支
git push
# 强制推送更新
git push -f
echo "sync_status=updated" >> $GITHUB_OUTPUT
# 只有当仓库不是最新且同步成功时,才继续执行后续步骤