Skip to content

Commit

Permalink
Merge pull request #19 from ryan4yin/mirror-to-gitee
Browse files Browse the repository at this point in the history
feat: mirror repo to gitee
  • Loading branch information
ryan4yin authored Oct 4, 2023
2 parents d3afda0 + de49657 commit fb5f273
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/mirror_to_gitee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Mirror this repo to Gitee
on:
workflow_dispatch: {}
push: {}
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- 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]:ryan_yin/knowledge.git
run: |
set -eu
mkdir -p ~/.ssh
echo "$INPUT_SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
export GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no"
git remote add mirror "$INPUT_TARGET_REPO_URL"
git push --tags --force --prune mirror "refs/remotes/origin/*:refs/heads/*"

0 comments on commit fb5f273

Please sign in to comment.