CI 修复:clone URL 自适应 http/https(GITHUB_SERVER_URL 为内网地址时的 scheme 处理)
Release 镜像 / 测试(推送前置门禁) (push) Successful in 47s
Release 镜像 / 多架构构建并推送 ACR (push) Failing after 1s

This commit is contained in:
2026-09-05 06:36:17 +08:00
parent 6f1a925833
commit 27b8b75136
+8 -2
View File
@@ -24,8 +24,11 @@ jobs:
run: |
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
apk add --no-cache git curl bash >/dev/null
SCHEME="${GITHUB_SERVER_URL%%://*}"
SRV="${GITHUB_SERVER_URL#*://}"
echo "clone from ${SCHEME}://${SRV}"
git clone --depth=1 --branch "$GITHUB_REF_NAME" \
"https://oauth2:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
"${SCHEME}://oauth2:${GITHUB_TOKEN}@${SRV}/${GITHUB_REPOSITORY}.git" .
- name: go vet + go test
working-directory: server
@@ -49,8 +52,11 @@ jobs:
run: |
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
apk add --no-cache git curl bash >/dev/null
SCHEME="${GITHUB_SERVER_URL%%://*}"
SRV="${GITHUB_SERVER_URL#*://}"
echo "clone from ${SCHEME}://${SRV}"
git clone --depth=1 --branch "$GITHUB_REF_NAME" \
"https://oauth2:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
"${SCHEME}://oauth2:${GITHUB_TOKEN}@${SRV}/${GITHUB_REPOSITORY}.git" .
# 嵌入产物同步(保证二进制内前端与仓库一致)
if [ -f web-embed/index.html ]; then :; fi