.github/workflows/update_json.yml #30
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: Manual JSON Sync | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
update_json: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Download JSON | |
run: curl -o tvbox.json https://www.xzbgg.top/tvbox.json | |
- name: Check if JSON has changed | |
id: check_changes | |
run: | | |
git diff --exit-code tvbox.json || echo "::set-output name=has_changes::true" | |
continue-on-error: true | |
- name: Commit and push changes | |
if: steps.check_changes.outputs.has_changes == 'true' | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "Update tvbox.json $(date '+%Y-%m-%d %H:%M:%S')" | |
git push |