.github/workflows/sync.yml #4590
This file contains hidden or 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
| on: | |
| schedule: | |
| - cron: '0 * * * *' # every hour | |
| workflow_dispatch: # allow manual | |
| jobs: | |
| sync: | |
| name: Sync SensEdu | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Library Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: master | |
| - name: Sync Original Folder | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| git remote add upstream https://github.com/ShiegeChan/SensEdu.git | |
| git fetch upstream | |
| git checkout upstream/main -- libraries/SensEdu | |
| cp -r -f libraries/SensEdu/* ./ | |
| rm -r libraries | |
| git add . | |
| if git diff-index --quiet HEAD --; then | |
| echo "No changes, exiting..." | |
| exit 0 | |
| fi | |
| git commit -m "Sync: Updates from original repo libraries/SensEdu" | |
| git push origin master |