Skip to content

Commit

Permalink
Create sync.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Adityasinh-Sodha authored Dec 31, 2024
1 parent 9adf12d commit eb50444
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows.github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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: Set Git User Info
run: |
git config --global user.email "[email protected]"
git config --global user.name "Adityasinh-Sodha"
- 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/PhisherMan.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

0 comments on commit eb50444

Please sign in to comment.