fix: cicd-调整3
Some checks failed
JT808 CI/CD / build-and-deploy (push) Failing after 0s

This commit is contained in:
lzh
2025-12-12 15:52:38 +08:00
parent 24f8570f33
commit 668cd43527

View File

@@ -21,7 +21,9 @@ jobs:
cd repo
if [ -n "${CLONE_TOKEN:-}" ]; then
AUTH_URL="$(printf '%s' "${CLONE_URL}" | sed -E "s#^https?://#https://${CLONE_TOKEN}@#")"
# Some tokens may contain characters like '#', which would break sed if unescaped.
SAFE_TOKEN="$(printf '%s' "${CLONE_TOKEN}" | sed -e 's/[&|\\]/\\&/g')"
AUTH_URL="$(printf '%s' "${CLONE_URL}" | sed -E "s|^https?://|https://${SAFE_TOKEN}@|")"
git clone --no-tags --depth 1 "${AUTH_URL}" .
else
git clone --no-tags --depth 1 "${CLONE_URL}" .