-
Notifications
You must be signed in to change notification settings - Fork 8
84 lines (76 loc) · 2.5 KB
/
mirror-repo.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Mirror repo
on:
workflow_call:
inputs:
GITLAB_URL:
required: true
type: string
secrets:
GITLAB_USER:
required: true
GITLAB_PASSWORD:
required: true
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: mirror-1
uses: yesolutions/mirror-action@master
continue-on-error: true
with:
REMOTE: ${{ inputs.GITLAB_URL }}
GIT_USERNAME: ${{ secrets.GITLAB_USER }}
GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
- run: sleep 60s
shell: bash
if: ${{ steps.mirror-1.outcome == 'failure' }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
if: ${{ steps.mirror-1.outcome == 'failure' }}
- run: sudo git remote remove mirror || true
if: ${{ steps.mirror-1.outcome == 'failure' }}
- id: mirror-2
uses: yesolutions/mirror-action@master
continue-on-error: true
with:
REMOTE: ${{ inputs.GITLAB_URL }}
GIT_USERNAME: ${{ secrets.GITLAB_USER }}
GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
if: ${{ steps.mirror-1.outcome == 'failure' }}
- run: sleep 60s
shell: bash
if: ${{ steps.mirror-2.outcome == 'failure' }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
if: ${{ steps.mirror-2.outcome == 'failure' }}
- run: sudo git remote remove mirror || true
if: ${{ steps.mirror-2.outcome == 'failure' }}
- id: mirror-3
uses: yesolutions/mirror-action@master
continue-on-error: true
with:
REMOTE: ${{ inputs.GITLAB_URL }}
GIT_USERNAME: ${{ secrets.GITLAB_USER }}
GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
if: ${{ steps.mirror-2.outcome == 'failure' }}
- run: sleep 60s
shell: bash
if: ${{ steps.mirror-3.outcome == 'failure' }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
if: ${{ steps.mirror-3.outcome == 'failure' }}
- run: sudo git remote remove mirror || true
if: ${{ steps.mirror-3.outcome == 'failure' }}
- id: mirror-4
uses: yesolutions/mirror-action@master
with:
REMOTE: ${{ inputs.GITLAB_URL }}
GIT_USERNAME: ${{ secrets.GITLAB_USER }}
GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
if: ${{ steps.mirror-3.outcome == 'failure' }}