Skip to content

Fix text-encoding workflow #50

Fix text-encoding workflow

Fix text-encoding workflow #50

name: Mirror repo to Gitee
on:
workflow_dispatch: {}
push: {}
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Fetch bare repo
run:
git clone --mirror https://github.com/${{ github.repository }}.git repository
- name: Mirror repo to Gitee
id: mirror-to-gitee
shell: bash
env:
INPUT_SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY_GITEE_MIRROR }}
INPUT_TARGET_REPO_URL: git@gitee.com:Mq-b/Loser-HomeWork.git
run: |
set -eu
cd repository
mkdir -p ~/.ssh
echo "$INPUT_SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
export GIT_SSH_COMMAND="ssh -v -o StrictHostKeyChecking=accept-new"
git push --force --prune --tags "$INPUT_TARGET_REPO_URL" "+refs/heads/*:refs/heads/*"