Sync Repo #11
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 Repo | |
on: | |
schedule: | |
- cron: "0 * * * *" | |
workflow_dispatch: | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout This Repo | |
uses: actions/checkout@v3 | |
- name: Checkout Target Repo | |
uses: actions/checkout@v3 | |
with: | |
repository: RotCHM/RotCHM | |
ref: main | |
- name: Sync Code | |
run: | | |
rsync -av --delete ./ ./../sync/ | |
cd ../sync/ | |
git config user.name "GitHub Actions" | |
git config user.email "actions@github.com" | |
git add . | |
git commit -m "Sync from upstream repo" || echo "No changes to commit" | |
- name: Force Pull and Push Changes | |
run: | | |
git remote set-url origin https://hatton613:${{ secrets.PAT }}@github.com/hatton613/BearLLM.git | |
git fetch origin main | |
git reset --hard origin/main | |
git push origin main --force |