-
Notifications
You must be signed in to change notification settings - Fork 293
48 lines (42 loc) · 1.43 KB
/
sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Sync-To-TGIT
on:
push:
branches:
- main
jobs:
push-to-mirror:
runs-on: ubuntu-latest
steps:
- name: Clone
run: |
git init
git remote add origin https://github.com/${GITHUB_REPOSITORY}.git
git fetch --all
for branch in `git branch -a | grep remotes | grep -v HEAD`; do
git branch --track ${branch#remotes/origin/} $branch
done
env:
GITHUB_REPOSITORY: Tencent/CodeAnalysis
- name: Push to TGIT
run: |
remote_repo="https://${TGIT_USERNAME}:${TGIT_PASSWORD}@git.code.tencent.com/${TGIT_REPOSITORY}.git"
git remote add tgit "${remote_repo}"
git show-ref
git branch --verbose
git push --all --force tgit
git push --tags --force tgit
env:
TGIT_REPOSITORY: Tencent_Open_Source/CodeAnalysis
TGIT_USERNAME: ${{ secrets.USERNAME }}
TGIT_PASSWORD: ${{ secrets.PASSWORD }}
continue-on-error: true
- name: Push to CNB
run: |
remote_repo="https://${CNB_USERNAME}:${CNB_PASSWORD}@cnb.cool/${CNB_REPOSITORY}.git"
git remote add cnb "${remote_repo}"
git push --all --force cnb
git push --tags --force cnb
env:
CNB_REPOSITORY: tca/code-analysis
CNB_USERNAME: ${{ secrets.CNB_USERNAME }}
CNB_PASSWORD: ${{ secrets.CNB_PASSWORD }}