Trackerslist #610
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
name: Trackerslist | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
env: | |
TZ: Asia/Shanghai | |
jobs: | |
trackerslist_autoupdate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 # 修正使用 setup-python 而非 checkout | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
pip install --upgrade pip | |
pip install requests | |
- name: Run script to update trackerslist | |
run: | | |
source venv/bin/activate | |
python trackerslist.py | |
- name: Remove old virtual environment | |
run: | | |
if [ -d "venv" ]; then | |
rm -rf venv | |
fi | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add . | |
git commit -m "Update trackerslist" | |
git push |