From 49de0152dacd60bd459f19f43a6b9324fb9acaaa Mon Sep 17 00:00:00 2001 From: ange Date: Mon, 18 Nov 2024 11:16:45 +0000 Subject: [PATCH] fix: fetch mandatory --- mirror.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mirror.sh b/mirror.sh index ab195d6..1349474 100755 --- a/mirror.sh +++ b/mirror.sh @@ -5,5 +5,9 @@ echo "$INPUT_SSH_PRIV" > "$HOME/.ssh/id_ed25519" echo "$INPUT_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts" chmod 600 "$HOME/.ssh/id_ed25519" -git remote set-url --push origin "$INPUT_URL" -git push origin "main:$GITHUB_REF_NAME" +URL="${GITHUB_SERVER_URL/\/\//\/\/$GITHUB_REPOSITORY_OWNER:$INPUT_TOKEN@}/$GITHUB_REPOSITORY" + +git init -b "$GITHUB_REF_NAME" +git remote add origin "$URL" +git fetch -pP +git push origin --repo="$INPUT_URL" --mirror