Skip to content

Commit 4d90471

Browse files
authored
Merge pull request #1 from tencentcloudstack/fix/sync-code
Create sync-code.yaml
2 parents 9d7f28f + 992d4a8 commit 4d90471

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/sync-code.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: sync-code
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'coding-test/**'
8+
- 'pipeline/**'
9+
tags: v*
10+
11+
jobs:
12+
sync:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: clone
17+
run: |
18+
if [ -d packer-plugin-tencentcloud ]; then
19+
rm -rf packer-plugin-tencentcloud
20+
fi
21+
git clone https://github.com/tencentcloudstack/packer-plugin-tencentcloud.git
22+
- name: sync
23+
run: |
24+
cd packer-plugin-tencentcloud
25+
git fetch --all
26+
git branch -r --list "origin/coding-test/*" | grep -v HEAD | grep -v master | xargs -I {} git checkout -t {}
27+
git branch -r --list "origin/pipeline/*" | grep -v HEAD | grep -v master | xargs -I {} git checkout -t {}
28+
git remote add tgit_origin https://${{ secrets.USERNAME }}:${{ secrets.PASSWORD }}@git.code.tencent.com/tencentcloudstack/packer-plugin-tencentcloud.git
29+
git push -u tgit_origin -f --all
30+
git push -u tgit_origin main:main
31+
git push -u tgit_origin --tags

0 commit comments

Comments
 (0)