first commit

This commit is contained in:
ange 2024-11-18 10:26:37 +00:00
commit aecdde7761
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
3 changed files with 26 additions and 0 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
# mirror@v1

16
action.yaml Normal file
View File

@ -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

9
mirror.sh Executable file
View File

@ -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"