[0.2.7.4][ci]
Some checks failed
CI / docker-ci (push) Failing after 3s

This commit is contained in:
2026-03-18 21:16:04 +08:00
parent 71e34a57f1
commit ecd9933c0f

View File

@@ -74,10 +74,10 @@ jobs:
if [ -z "$AUTH_TOKEN" ]; then
git fetch --depth=1 "$SERVER/$REPO.git" "$REF"
elif [ "$USE_BASIC_AUTH" = "true" ]; then
# 使用 Basic Auth: https://token:x-oauth-basic@gitea.com/user/repo.git
# 使用 Gitea 支持的 Basic Auth: https://x-access-token:token@gitea.domain/user/repo.git
# 去掉 SERVER 中的 https:// 或 http:// 前缀以构建正确的 URL
CLEAN_SERVER=$(echo "$SERVER" | sed -E 's/^\s*.*:\/\///g')
git fetch --depth=1 "https://$AUTH_TOKEN:x-oauth-basic@$CLEAN_SERVER/$REPO.git" "$REF"
git fetch --depth=1 "https://x-access-token:$AUTH_TOKEN@$CLEAN_SERVER/$REPO.git" "$REF"
else
# 使用 Bearer Token 进行认证
git -c http.extraHeader="Authorization: Bearer $AUTH_TOKEN" fetch --depth=1 "$SERVER/$REPO.git" "$REF"