commit aecdde7761658c7a5d8e19b0f54fdad7bec5c753 Author: ange Date: Mon Nov 18 10:26:37 2024 +0000 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d6048f --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# mirror@v1 diff --git a/action.yaml b/action.yaml new file mode 100644 index 0000000..f515d44 --- /dev/null +++ b/action.yaml @@ -0,0 +1,16 @@ +inputs: + ssh_priv: + description: SSH key to push to url + required: true + known_hosts: + description: content of ~/.ssh/known_hosts + required: true + url: + description: push destination + required: true + +runs: + using: composite + steps: + - name: Checkout + run: ${{ gitea.action_path }}/checkout.sh diff --git a/mirror.sh b/mirror.sh new file mode 100755 index 0000000..7b6aade --- /dev/null +++ b/mirror.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e + +mkdir -p "$HOME/.ssh" +echo "$INPUT_SSH_PRIV" > "$HOME/.ssh/id_ed25519" +echo "$INPUT_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts" + +git remote set-url --push origin "$INPUT_URL" +git checkout "$GITHUB_REF_NAME" +git push origin "$GITHUB_REF_NAME"