fix(core): syntaxe
This commit is contained in:
@@ -26,8 +26,18 @@ jobs:
|
||||
MIRROR_URL: ${{ secrets.MIRROR_REPO_URL }}
|
||||
MIRROR_TOKEN: ${{ secrets.MIRROR_REPO_TOKEN }}
|
||||
run: |
|
||||
# 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@}"
|
||||
else
|
||||
# URL without protocol
|
||||
AUTH_URL="https://$GIT_USER_NAME:$MIRROR_TOKEN@$MIRROR_URL"
|
||||
fi
|
||||
|
||||
# Add mirror remote with authentication
|
||||
git remote add mirror https://$GIT_USER_NAME:$MIRROR_TOKEN@${MIRROR_URL#https://}
|
||||
git remote add mirror "$AUTH_URL"
|
||||
|
||||
# Push to mirror
|
||||
git push mirror main --force
|
||||
|
||||
Reference in New Issue
Block a user