fix(core): try
Some checks failed
Sync to mirror repository / sync (push) Failing after 1m2s
Publish content / push (push) Successful in 1m38s
Publish content / build (push) Successful in 1m54s
Publish content / deploy (push) Has been cancelled

This commit is contained in:
2025-11-02 18:42:16 +01:00
parent 400e1d3cdd
commit 043d0f70aa

View File

@@ -26,16 +26,25 @@ jobs:
MIRROR_URL: ${{ secrets.MIRROR_REPO_URL }}
MIRROR_TOKEN: ${{ secrets.MIRROR_REPO_TOKEN }}
run: |
# URL encode special characters in credentials
ENCODED_USER=$(printf %s "$GIT_USER_NAME" | jq -sRr @uri)
ENCODED_TOKEN=$(printf %s "$MIRROR_TOKEN" | jq -sRr @uri)
# Build authenticated URL
if [[ "$MIRROR_URL" == http* ]]; then
# URL already contains protocol
AUTH_URL="${MIRROR_URL/https:\/\//https://$GIT_USER_NAME:$MIRROR_TOKEN@}"
AUTH_URL="${AUTH_URL/http:\/\//http://$GIT_USER_NAME:$MIRROR_TOKEN@}"
if [[ "$MIRROR_URL" == https://* ]]; then
# URL with https protocol
CLEAN_URL="${MIRROR_URL#https://}"
AUTH_URL="https://${ENCODED_USER}:${ENCODED_TOKEN}@${CLEAN_URL}"
elif [[ "$MIRROR_URL" == http://* ]]; then
# URL with http protocol
CLEAN_URL="${MIRROR_URL#http://}"
AUTH_URL="http://${ENCODED_USER}:${ENCODED_TOKEN}@${CLEAN_URL}"
else
# URL without protocol
AUTH_URL="https://$GIT_USER_NAME:$MIRROR_TOKEN@$MIRROR_URL"
AUTH_URL="https://${ENCODED_USER}:${ENCODED_TOKEN}@${MIRROR_URL}"
fi
echo $AUTH_URL
# Add mirror remote with authentication
git remote add mirror "$AUTH_URL"