From aecdde7761658c7a5d8e19b0f54fdad7bec5c753 Mon Sep 17 00:00:00 2001 From: ange Date: Mon, 18 Nov 2024 10:26:37 +0000 Subject: [PATCH] first commit --- README.md | 1 + action.yaml | 16 ++++++++++++++++ mirror.sh | 9 +++++++++ 3 files changed, 26 insertions(+) create mode 100644 README.md create mode 100644 action.yaml create mode 100755 mirror.sh 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"