-
Notifications
You must be signed in to change notification settings - Fork 136
31 lines (27 loc) · 958 Bytes
/
sync-code.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
# This is a sync code to tgit workflow
name: sync-code
on:
push:
branches:
- master
- 'coding-test/**'
- 'pipeline/**'
tags: v*
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: clone
run: |
if [ -d terraform-provider-tencentcloud ]; then
rm -rf terraform-provider-tencentcloud
fi
git clone https://github.com/tencentcloudstack/terraform-provider-tencentcloud.git
- name: sync
run: |
cd terraform-provider-tencentcloud
git fetch --all
git remote add tgit_origin https://${{ secrets.USERNAME }}:${{ secrets.PASSWORD }}@git.code.tencent.com/tencentcloudstack/terraform-provider-tencentcloud.git
for remote in `git branch -r | grep -v "\->" | grep -v "master"`; do git branch --track ${remote#origin/} $remote; done
git push -f --tags tgit_origin master:main
git push -f --all tgit_origin