1028
All checks were successful
Clone Repository with Trojan-Go Proxy / clone_with_proxy (push) Successful in 32s

This commit is contained in:
298977887 2024-10-28 01:22:49 +08:00
parent a1b5d3fc8f
commit b7def1390d

View File

@ -54,17 +54,29 @@ jobs:
http_proxy: "socks5://127.0.0.1:1080"
https_proxy: "socks5://127.0.0.1:1080"
run: |
echo "Checking ALL_PROXY: $ALL_PROXY"
echo "检查代理设置:$ALL_PROXY"
echo "开始尝试克隆仓库..."
# 尝试多次克隆仓库,直到成功
n=0
until [ "$n" -ge 5 ]
n=1
max_retries=5
while [ "$n" -le "$max_retries" ]
do
git clone --depth 1 $REPO_URL -b $REPO_BRANCH && break
echo "正在尝试第 $n 次克隆仓库..."
git clone --depth 1 "$REPO_URL" -b "$REPO_BRANCH" && break
echo "第 $n 次克隆失败将在5秒后重试..."
n=$((n+1))
echo "Retrying clone in 5 seconds... ($n/5)"
sleep 5
done
# 检查克隆是否成功
if [ "$n" -gt "$max_retries" ]; then
echo "克隆仓库失败,请检查网络或代理设置。"
exit 1
else
echo "仓库克隆成功!"
fi
# 1. 不使用代理的步骤
- name: 🌐 Step without Proxy
run: |