-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.28 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
49
50
51
52
name: Sync Repos
on:
push:
branches:
- main
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Unshallow Clone (if needed)
run: |
if [ -f .git/shallow ]; then
git fetch --unshallow
else
echo "Repository is already complete. No need to unshallow."
fi
- name: Pull from GitLab
env:
GITLAB_TOKEN: ${{ secrets.GITLAB }}
run: |
git remote add gitlab https://Adityasinh-Sodha:[email protected]/Adityasinh-Sodha/MaxEdit.git
git fetch gitlab main
git rebase gitlab/main || git rebase --skip
- name: Push to GitLab
env:
GITLAB_TOKEN: ${{ secrets.GITLAB }}
run: |
git push gitlab main
- name: Pull from Bitbucket
env:
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET }}
run: |
git remote add bitbucket https://adityasinh-sodha:[email protected]/adityasinh-sodha/MaxEdit.git
git pull bitbucket main --rebase
- name: Push to Bitbucket
env:
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET }}
run: |
git push bitbucket main