mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-01 19:27:39 +08:00
Added mirror repo to cnb.cool. (#7108)
This commit is contained in:
parent
89a8f45fab
commit
6a4f612572
20
.github/workflows/cnb.yml
vendored
Normal file
20
.github/workflows/cnb.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user