更新一节卢瑟日经 #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [email protected]: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/*" |