|
12 | 12 | #- cron: "0 0 * * *" |
13 | 13 | workflow_dispatch: |
14 | 14 |
|
| 15 | + |
15 | 16 | jobs: |
16 | 17 | sync-gitlink: |
17 | 18 | runs-on: ubuntu-latest |
@@ -46,21 +47,22 @@ jobs: |
46 | 47 |
|
47 | 48 | # 添加远端 |
48 | 49 | - name: add remote url |
49 | | - run: git remote add gitlink "git@code.gitlink.org.cn:${{ github.Repository }}.git" |
| 50 | + run: git remote add mirror "git@code.gitlink.org.cn:${{ github.Repository }}.git" |
50 | 51 |
|
51 | 52 | # 获取 |
52 | 53 | - name: fetch |
53 | | - run: git fetch --prune gitlink --tags --verbose |
| 54 | + run: git fetch --prune mirror --tags --verbose |
54 | 55 |
|
55 | | - # 拉取 |
| 56 | + # 拉取和推送 |
56 | 57 | - name: pull and push |
57 | 58 | run: | |
58 | 59 | if [ "${{ github.ref_name }}" ]; then |
59 | 60 | git checkout ${{ github.ref_name }} |
60 | | - git pull --progress -v --no-rebase gitlink ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支; |
61 | | - git push -u gitlink ${{ github.ref_name }} --tags --verbose |
| 61 | + git push -f mirror ${{ github.ref_name }} |
| 62 | + git push -f mirror --tags --verbose |
62 | 63 | fi |
63 | 64 |
|
| 65 | +
|
64 | 66 | sync-gitlab: |
65 | 67 | runs-on: ubuntu-latest |
66 | 68 |
|
@@ -92,21 +94,22 @@ jobs: |
92 | 94 |
|
93 | 95 | # 添加远端 |
94 | 96 | - name: add remote url |
95 | | - run: git remote add gitlab "git@gitlab.com:${{ github.Repository }}.git" |
| 97 | + run: git remote add mirror "git@gitlab.com:${{ github.Repository }}.git" |
96 | 98 |
|
97 | 99 | # 获取 |
98 | 100 | - name: fetch |
99 | | - run: git fetch --prune gitlab --tags --verbose |
| 101 | + run: git fetch --prune mirror --tags --verbose |
100 | 102 |
|
101 | | - # 拉取 |
| 103 | + # 拉取和推送 |
102 | 104 | - name: pull and push |
103 | 105 | run: | |
104 | 106 | if [ "${{ github.ref_name }}" ]; then |
105 | 107 | git checkout ${{ github.ref_name }} |
106 | | - git pull --progress -v --no-rebase gitlab ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支; |
107 | | - git push -u gitlab ${{ github.ref_name }} --tags --verbose |
| 108 | + git push -f mirror ${{ github.ref_name }} |
| 109 | + git push -f mirror --tags --verbose |
108 | 110 | fi |
109 | 111 |
|
| 112 | +
|
110 | 113 | sync-gitee: |
111 | 114 | runs-on: ubuntu-latest |
112 | 115 |
|
@@ -138,21 +141,22 @@ jobs: |
138 | 141 |
|
139 | 142 | # 添加远端 |
140 | 143 | - name: add remote url |
141 | | - run: git remote add gitee "git@gitee.com:${{ github.Repository }}.git" |
| 144 | + run: git remote add mirror "git@gitee.com:${{ github.Repository }}.git" |
142 | 145 |
|
143 | 146 | # 获取 |
144 | 147 | - name: fetch |
145 | | - run: git fetch --prune gitee --tags --verbose |
| 148 | + run: git fetch --prune mirror --tags --verbose |
146 | 149 |
|
147 | | - # 拉取 |
| 150 | + # 拉取和推送 |
148 | 151 | - name: pull and push |
149 | 152 | run: | |
150 | 153 | if [ "${{ github.ref_name }}" ]; then |
151 | 154 | git checkout ${{ github.ref_name }} |
152 | | - git pull --progress -v --no-rebase gitee ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支; |
153 | | - git push -u gitee ${{ github.ref_name }} --tags --verbose |
| 155 | + git push -f mirror ${{ github.ref_name }} |
| 156 | + git push -f mirror --tags --verbose |
154 | 157 | fi |
155 | 158 |
|
| 159 | +
|
156 | 160 | sync-atomgit: |
157 | 161 | runs-on: ubuntu-latest |
158 | 162 |
|
@@ -184,21 +188,22 @@ jobs: |
184 | 188 |
|
185 | 189 | # 添加远端 |
186 | 190 | - name: add remote url |
187 | | - run: git remote add atomgit "git@atomgit.com:${{ github.Repository }}.git" |
| 191 | + run: git remote add mirror "git@atomgit.com:${{ github.Repository }}.git" |
188 | 192 |
|
189 | 193 | # 获取 |
190 | 194 | - name: fetch |
191 | | - run: git fetch --prune atomgit --tags --verbose |
| 195 | + run: git fetch --prune mirror --tags --verbose |
192 | 196 |
|
193 | | - # 拉取 |
| 197 | + # 拉取和推送 |
194 | 198 | - name: pull and push |
195 | 199 | run: | |
196 | 200 | if [ "${{ github.ref_name }}" ]; then |
197 | 201 | git checkout ${{ github.ref_name }} |
198 | | - git pull --progress -v --no-rebase atomgit ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支; |
199 | | - git push -u atomgit ${{ github.ref_name }} --tags --verbose |
| 202 | + git push -f mirror ${{ github.ref_name }} |
| 203 | + git push -f mirror --tags --verbose |
200 | 204 | fi |
201 | 205 |
|
| 206 | +
|
202 | 207 | sync-gitcode: |
203 | 208 | runs-on: ubuntu-latest |
204 | 209 |
|
@@ -230,20 +235,21 @@ jobs: |
230 | 235 |
|
231 | 236 | # 添加远端 |
232 | 237 | - name: add remote url |
233 | | - run: git remote add gitcode "git@gitcode.net:${{ github.Repository }}.git" |
| 238 | + run: git remote add mirror "git@gitcode.net:${{ github.Repository }}.git" |
234 | 239 |
|
235 | 240 | # 获取 |
236 | 241 | - name: fetch |
237 | | - run: git fetch --prune gitcode --tags --verbose |
| 242 | + run: git fetch --prune mirror --tags --verbose |
238 | 243 |
|
239 | | - # 拉取 |
| 244 | + # 拉取和推送 |
240 | 245 | - name: pull and push |
241 | 246 | run: | |
242 | 247 | if [ "${{ github.ref_name }}" ]; then |
243 | 248 | git checkout ${{ github.ref_name }} |
244 | | - git pull --progress -v --no-rebase gitcode ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支; |
245 | | - git push -u gitcode ${{ github.ref_name }} --tags --verbose |
| 249 | + git push -f mirror ${{ github.ref_name }} |
| 250 | + git push -f mirror --tags --verbose |
246 | 251 | fi |
| 252 | +
|
247 | 253 | |
248 | 254 | sync-framagit: |
249 | 255 | runs-on: ubuntu-latest |
@@ -276,17 +282,17 @@ jobs: |
276 | 282 |
|
277 | 283 | # 添加远端 |
278 | 284 | - name: add remote url |
279 | | - run: git remote add framagit "git@framagit.org:${{ github.Repository }}.git" |
| 285 | + run: git remote add mirror "git@framagit.org:${{ github.Repository }}.git" |
280 | 286 |
|
281 | 287 | # 获取 |
282 | 288 | - name: fetch |
283 | | - run: git fetch --prune framagit --tags --verbose |
| 289 | + run: git fetch --prune mirror --tags --verbose |
284 | 290 |
|
285 | | - # 拉取 |
| 291 | + # 拉取和推送 |
286 | 292 | - name: pull and push |
287 | 293 | run: | |
288 | 294 | if [ "${{ github.ref_name }}" ]; then |
289 | 295 | git checkout ${{ github.ref_name }} |
290 | | - git pull --progress -v --no-rebase framagit ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支; |
291 | | - git push -u framagit ${{ github.ref_name }} --tags --verbose |
| 296 | + git push -f mirror ${{ github.ref_name }} |
| 297 | + git push -f mirror --tags --verbose |
292 | 298 | fi |
0 commit comments