Update sync.yml #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 pull gitlab main --rebase | |
- 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 |