Files
tvbox_collect/tvbox/.github/workflows/toos.yml
T
2026-06-29 03:41:14 +00:00

84 lines
2.0 KiB
YAML

name: Update Toos
permissions:
contents: write
actions: write
pull-requests: write # 'write' access to pull requests
on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
env:
TZ: Asia/Shanghai
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Update:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
repository: cluntop/tvbox
token: ${{ secrets.GIT_TOKEN }}
fetch-depth: 0
- name: Delete old workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 1
keep_minimum_runs: 3
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f .github/requirements.txt ]; then pip install -r .github/requirements.txt; fi
pip install aiohttp
- name: Run M3U script
run: |
python py/ssjh.py
- name: Submit the changes
run: |
export HOME=${GITHUB_WORKSPACE}
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# if [ -n "$(git status --porcelain)" ]; then
# echo "Changes detected, committing..."
# git add .
# git commit -m "Update m3u"
# git pull --rebase origin main
# git push origin main
# else
# echo "No changes detected, skipping push."
# fi
git commit -a -m "Update m3u"
- name: Push changes
uses: ad-m/github-push-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
# pull: rebase # pull --rebase before push; also accepts: merge | ff-only | true