mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 03:37:44 +08:00
22 lines
817 B
YAML
22 lines
817 B
YAML
name: Mirror to CNB Repo
|
|
|
|
on: [ push, delete, create ]
|
|
|
|
jobs:
|
|
git-mirror:
|
|
if: github.repository == 'hyperf/hyperf'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Push Mirror
|
|
if: github.repository_owner == 'hyperf'
|
|
env:
|
|
SOURCE_REPO: 'https://github.com/hyperf/hyperf.git'
|
|
DESTINATION_REPO: 'https://cnb:${{ secrets.CNB_TOKEN }}@cnb.cool/hyperf/hyperf.git'
|
|
run: |
|
|
git clone --mirror "$SOURCE_REPO" && cd `basename "$SOURCE_REPO"`
|
|
# git remote set-url --push origin "$DESTINATION_REPO"
|
|
# git fetch -p origin
|
|
# git for-each-ref --format 'delete %(refname)' refs/pull | git update-ref --stdin
|
|
# git push --mirror
|
|
git push -f --prune "$DESTINATION_REPO" "refs/heads/*:refs/heads/*" "refs/tags/*:refs/tags/*"
|