-
-
Notifications
You must be signed in to change notification settings - Fork 19
22 lines (20 loc) · 934 Bytes
/
cnb.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
name: Mirror to CNB Repo
on: [ push, delete, create ]
jobs:
git-mirror:
if: github.repository == 'friendsofhyperf/components'
runs-on: ubuntu-latest
steps:
- name: Push Mirror
if: github.repository_owner == 'friendsofhyperf'
env:
SOURCE_REPO: 'https://github.com/friendsofhyperf/components.git'
DESTINATION_REPO: 'https://cnb:${{ secrets.CNB_TOKEN }}@cnb.cool/friendsofhyperf/components.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 clone --mirror "$SOURCE_REPO" && cd `basename "$SOURCE_REPO"`
git push -f "$DESTINATION_REPO" "refs/heads/*:refs/heads/*" "refs/tags/*:refs/tags/*"