Add GitHub Actions workflow for M3U playlist generation

This workflow generates M3U playlists on push or pull request events, using a Python script and commits the generated files back to the repository.
This commit is contained in:
Vlastimil Novotný 2026-07-01 23:09:17 +02:00 • committed by GitHub
parent 22e19b6e0b
commit 6110184463
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,46 @@
name: Generate M3U Playlists
on:
push:
branches:
- main
- master
paths:
- 'channels/**'
- 'generator.py'
- '.github/workflows/**'
pull_request:
branches:
- main
- master
paths:
- 'channels/**'
- 'generator.py'
jobs:
generate-playlists:
runs-on: ubuntu-latest
# Required permissions to allow GitHub Actions to push changes back to the repository
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Run playlist generator
run: python generator.py
- name: Commit and push generated M3U files (Push events only)
if: github.event_name == 'push'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: auto-update m3u playlists [skip ci]"
file_pattern: main/
branch: ${{ github.head_ref || github.ref_name }}