M3U Updator #11656
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: M3U Updator | |
on: | |
schedule: | |
- cron: '*/30 * * * *' # Runs every 30 minutes | |
push: | |
branches: | |
- main # Runs on push to the main branch | |
workflow_dispatch: # Allows manual triggering of the workflow | |
jobs: | |
build: | |
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.x' | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run script | |
env: | |
PLAYLIST_SOURCE_URL_1: ${{ secrets.PLAYLIST_SOURCE_URL_1 }} | |
PLAYLIST_SOURCE_URL_2: ${{ secrets.PLAYLIST_SOURCE_URL_2 }} | |
PLAYLIST_SOURCE_URL_3: ${{ secrets.PLAYLIST_SOURCE_URL_3 }} | |
run: | | |
chmod +x autorun.sh | |
./autorun.sh | |
- name: Commit changes if any | |
run: | | |
git config --global user.email "action@github.com" | |
git config --global user.name "GitHub Action" | |
git add -A | |
git diff --quiet && git diff --staged --quiet || git commit -m "M3U files updated by bot 🤖" | |
- name: Pull latest changes from remote | |
run: git pull origin main --rebase | |
- name: Push changes | |
run: git push origin main | |