-
Notifications
You must be signed in to change notification settings - Fork 14
58 lines (49 loc) · 1.78 KB
/
main.yml
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
52
53
54
55
56
57
58
name: M3U Generator
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
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 }}
PRIORITY_PLAYLIST_URL_1: ${{ secrets.PRIORITY_PLAYLIST_URL_1 }}
PRIORITY_PLAYLIST_URL_2: ${{ secrets.PRIORITY_PLAYLIST_URL_2 }}
PRIORITY_PLAYLIST_URL_3: ${{ secrets.PRIORITY_PLAYLIST_URL_3 }}
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
run: |
chmod +x autorun.sh
./autorun.sh
- name: Commit changes if any
run: |
git config --global user.email "[email protected]"
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
- name: Notify via Telegram
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
message: "M3U files updated successfully with new sources! 🚀"