Sync GitLab to GitHub #27
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 GitLab to GitHub | |
on: | |
schedule: | |
- cron: '0 */12 * * *' # Runs every 12 hours | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout GitHub repository | |
uses: actions/checkout@v4 | |
- name: Set up Git | |
run: | | |
git config --global user.name "GitHub Action" | |
git config --global user.email "[email protected]" | |
- name: Clone GitLab repository | |
run: | | |
git clone --mirror https://oauth2:${{ secrets.GITLAB_PAT }}@gitlab.com/walletscrutiny/walletScrutinyCom.git repo | |
cd repo | |
git remote set-url --push origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/WalletScrutiny/WalletScrutinyCom.git | |
git fetch origin | |
git push --force --mirror | |
- name: Confirm Sync Completion | |
run: echo "Sync completed successfully!" |