This commit is contained in:
@@ -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}" .
|
||||
|
||||
Reference in New Issue
Block a user