-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (40 loc) · 1.33 KB
/
main.yml
File metadata and controls
51 lines (40 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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