.github/workflows/iptv.yml #10
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: up iptv | |
on: | |
# schedule: | |
# - cron: '0 10 * * *' # UTC时间10点,即北京时间18点 | |
workflow_dispatch: # 允许手动触发工作流 | |
jobs: | |
sync_files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' # 使用Python 3.10版本 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests beautifulsoup4 PyGithub | |
- name: Run the main.py | |
run: | | |
python main.py | |
- name: List files | |
run: ls -la # 列出文件,方便调试 | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "csszue@gmail.com" | |
git config --local user.name "MemoryCollection" | |
git add *.txt | |
git commit -m "Sync TXT files" || echo "No changes to commit" | |
git push --force # 强制推送 | |