Skip to content

Sync Repo

Sync Repo #13

Workflow file for this run

name: Mirror Private Repo to Public Repo
on:
workflow_dispatch: # Allows the action to be triggered manually
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Checkout the private repository
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Configure Git user identity and safe directory
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git config --global --add safe.directory /github/workspace
- name: List contents of private repo (debug step)
run: ls -la
- name: Remove the Git directory from the private repo
run: |
rm -rf .git
- name: Checkout the public repository
uses: actions/checkout@v3
with:
repository: ClashKingInc/ClashKingAssets
token: ${{ secrets.PAT_TOKEN }}
path: public_repo
- name: Configure Git user identity for public repo
run: |
git config --global user.email "[email protected]"
git config --global user.name "MagicTheDev"
git config --global --add safe.directory /github/workspace/public_repo
- name: List contents of public repo (debug step)
run: ls -la public_repo
- name: Copy files to the public repository
run: |
rsync -av --exclude=public_repo ./ public_repo/
- name: List contents of public repo after copy (debug step)
run: ls -la public_repo
- name: Commit and push changes to public repository
run: |
cd public_repo
git add .
git commit -m "Mirror update from private repo" || echo "No changes to commit"
git push --force