Update Data #296
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: Update Data | |
on: | |
schedule: | |
- cron: '0 6 * * *' # 每天UTC時間6點執行,即UTC+8時間下午2點 | |
workflow_dispatch: | |
jobs: | |
update-and-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Update data | |
run: python update.py | |
- name: Commit and push if changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Voidful" | |
git add -A | |
git commit -m "Automated data update" -a || echo "No changes to commit" | |
git push |