From f73010a184a4cb45fa08b2e20f62849c26425f00 Mon Sep 17 00:00:00 2001 From: ange Date: Mon, 18 Nov 2024 11:23:18 +0000 Subject: [PATCH] fix: token required to clone current repo --- action.yaml | 7 +++++-- mirror.sh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/action.yaml b/action.yaml index a2481b9..db4b839 100644 --- a/action.yaml +++ b/action.yaml @@ -1,12 +1,15 @@ inputs: + token: + description: A token to authenticate clone current repo + default: ${{ gitea.token }} ssh_priv: description: SSH key to push to url required: true known_hosts: - description: content of ~/.ssh/known_hosts + description: Content of ~/.ssh/known_hosts required: true url: - description: push destination + description: Push destination required: true runs: diff --git a/mirror.sh b/mirror.sh index 1349474..4b0e5fa 100755 --- a/mirror.sh +++ b/mirror.sh @@ -7,7 +7,7 @@ chmod 600 "$HOME/.ssh/id_ed25519" URL="${GITHUB_SERVER_URL/\/\//\/\/$GITHUB_REPOSITORY_OWNER:$INPUT_TOKEN@}/$GITHUB_REPOSITORY" -git init -b "$GITHUB_REF_NAME" +git init -b main git remote add origin "$URL" git fetch -pP git push origin --repo="$INPUT_URL" --mirror