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

This commit is contained in:
298977887 2024-10-28 01:13:51 +08:00
parent 620ecd082f
commit 1d81dd710e

View File

@ -45,7 +45,7 @@ jobs:
- name: 🔍 启动并保持 Trojan-Go 运行
run: |
nohup trojan-go -config trojan-go-config.json > /tmp/trojan-go.log 2>&1 & disown
sleep 10 # 等待代理启动
sleep 5 # 等待代理启动
# 检查 Trojan-Go 是否在运行
if pgrep -x "trojan-go" > /dev/null
then
@ -55,6 +55,16 @@ jobs:
fi
# 4. 使用代理克隆仓库
#- name: 🚀 使用代理克隆仓库
# env:
# REPO_URL: https://github.com/coolsnowwolf/lede
# REPO_BRANCH: master
# ALL_PROXY: "socks5://127.0.0.1:1080"
# http_proxy: "socks5://127.0.0.1:1080"
# https_proxy: "socks5://127.0.0.1:1080"
# run: |
# echo "Checking ALL_PROXY: $ALL_PROXY"
# git clone --depth 1 $REPO_URL -b $REPO_BRANCH
- name: 🚀 使用代理克隆仓库
env:
REPO_URL: https://github.com/coolsnowwolf/lede
@ -64,7 +74,15 @@ jobs:
https_proxy: "socks5://127.0.0.1:1080"
run: |
echo "Checking ALL_PROXY: $ALL_PROXY"
git clone --depth 1 $REPO_URL -b $REPO_BRANCH
# 尝试多次克隆仓库,直到成功
n=0
until [ "$n" -ge 5 ]
do
git clone --depth 1 $REPO_URL -b $REPO_BRANCH && break
n=$((n+1))
echo "Retrying clone in 5 seconds... ($n/5)"
sleep 5
done
# 1. 不使用代理的步骤
- name: 🌐 Step without Proxy