theariatv.github.io/.github/workflows/check-streams.yml

44 lines
1.2 KiB
YAML

name: Check IPTV Streams
on:
schedule:
# Runs every day at 00:00 UTC
- cron: '0 0 * * *'
workflow_dispatch: # Allows you to run it manually from the Actions tab
permissions:
contents: write # Required to allow the action to commit and push changes
jobs:
check-streams:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Run stream checker
run: |
python checker.py
- name: Commit and Push Changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
# Only commit and push if there are actual changes
if git diff --staged --quiet; then
echo "No changes to commit. All streams are up to date."
else
git commit -m "Automated stream check: updated offline channels"
git push
echo "Changes committed and pushed successfully!"
fi