CI 修复:clone URL 自适应 http/https(GITHUB_SERVER_URL 为内网地址时的 scheme 处理)
This commit is contained in:
@@ -24,8 +24,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
apk add --no-cache git curl bash >/dev/null
|
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" \
|
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
|
- name: go vet + go test
|
||||||
working-directory: server
|
working-directory: server
|
||||||
@@ -49,8 +52,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
apk add --no-cache git curl bash >/dev/null
|
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" \
|
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
|
if [ -f web-embed/index.html ]; then :; fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user