mirror/mirror.sh
ange ac02523680
Revert "fix"
This reverts commit fa3bc468c4.
2024-11-18 16:23:09 +00:00

18 lines
496 B
Bash
Executable File

#!/bin/bash -e
mkdir -p "$HOME/.ssh"
echo "$INPUT_SSH_PRIV" > "$HOME/.ssh/id_ed25519"
echo "$INPUT_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts"
chmod 600 "$HOME/.ssh/id_ed25519"
URL="${GITHUB_SERVER_URL/\/\//\/\/$GITHUB_REPOSITORY_OWNER:$INPUT_TOKEN@}/$GITHUB_REPOSITORY"
cat -e "$HOME/.ssh/id_ed25519"
set -x
git init -b "$GITHUB_REF_NAME"
git remote add origin "$URL"
git fetch --no-tags --prune --no-recurse-submodules origin "$GITHUB_SHA"
git push "$INPUT_URL" "$GITHUB_REF_NAME:$GITHUB_REF"