Skip to content

update

update #88

Workflow file for this run

name: push to gitee
on:
push:
jobs:
push-to-gitee:
if: ${{ (github.repository_owner == 'jingjingxyk') && (github.repository == 'jingjingxyk/swoole-cli') }}
runs-on: ubuntu-latest
steps:
- name: install deps
run: |
sudo apt install openssh-client
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare Secret Key
env:
PUSH_TO_GITEE_SECRET_KEY: ${{ secrets.PUSH_TO_GITEE_SECRET_KEY }}
run: |
mkdir -p ~/.ssh/
printf "%s\n" "$PUSH_TO_GITEE_SECRET_KEY" > ~/.ssh/swoole-cli-github-push-to-gitee-key
chmod 0400 ~/.ssh/swoole-cli-github-push-to-gitee-key
cat > ~/.ssh/config <<'EOF'
Host gitee.com
Hostname gitee.com
Port 22
PreferredAuthentications publickey
StrictHostKeyChecking no
IdentityFile ~/.ssh/swoole-cli-github-push-to-gitee-key
EOF
ls -lh ~/.ssh/
ssh -T [email protected]
- name: push to gitee
run: |
git remote add gitee [email protected]:jingjingxyk/swoole-cli.git
git fetch gitee -a
git branch -r --list | grep -v -- '->' | grep 'gitee/' | sed 's/gitee\///' | xargs -I {} echo {}
git branch -r --list | grep -v -- '->' | grep 'origin/' | sed 's/origin\///' | xargs -I {} echo {}
git push gitee --mirror
# git branch -r --list 'origin/HEAD -> origin/*' | grep -vE 'github/HEAD' | sed 's/github\///' | xargs -I {} git push gitee :{}
# git push gitee --all
# git push gitee <branch name> --force
# git push -u gitee --all
# git push -u gitee --tags
# 拉去所有分支
# for b in`git branch -r | grep -v -- '->'`; do git branch --track ${b##origin/} $b; done