From 668cd435277fe704cd286b6b3092a912b49010f4 Mon Sep 17 00:00:00 2001 From: lzh Date: Fri, 12 Dec 2025 15:52:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20cicd-=E8=B0=83=E6=95=B43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci-deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-deploy.yml b/.gitea/workflows/ci-deploy.yml index e5be904..aa8827b 100644 --- a/.gitea/workflows/ci-deploy.yml +++ b/.gitea/workflows/ci-deploy.yml @@ -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}" .