-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (85 loc) · 3.15 KB
/
Copy pathget_daddy_m3u8.yml
File metadata and controls
99 lines (85 loc) · 3.15 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Generate M3U Playlist Daily
on:
schedule:
# Runs at 00:00 UTC every day
# You can customize the cron schedule as needed.
# For example, '0 3 * * *' would run at 3 AM UTC.
# See https://crontab.guru/ for help with cron schedules.
- cron: '0 5 * * *'
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
build-and-commit:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# This is important to allow committing back to the branch
# If you use a different branch, change 'main' accordingly
ref: main
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Use a recent Python 3 version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests beautifulsoup4 PyYAML
# Add any other dependencies your script might need here
- name: Run Python script
run: python get_daddy_m3u8.py
- name: Configure Git
run: |
git config --global user.name 'GitHub Actions Bot'
git config --global user.email 'actions-bot@github.com'
- name: Commit and push changes
run: |
# Add all generated files or specific files
# The script generates:
# - daddylive_channels_proxied.m3u
# - daddylive-channels-tvg-ids.txt
# - search_substrings.yaml (if it doesn't exist)
git add daddylive_channels_proxied.m3u daddylive-channels-tvg-ids.txt search_substrings.yaml
# Check if there are changes to commit
if git diff --staged --quiet; then
echo "No changes to commit."
else
git commit -m "Automated M3U and TVG ID update"
git push
echo "Changes committed and pushed."
fi
# Continue even if there are no changes to commit
continue-on-error: true
push-to-uncle-fox-epg:
needs: build-and-commit
runs-on: ubuntu-latest
steps:
- name: Checkout generated XML from source repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Copy XML file to temp directory
run: |
mkdir tmp_epg
cp daddylive_channels_proxied.m3u tmp_epg/all.m3u
- name: Checkout Uncle-Fox-EPG repository
uses: actions/checkout@v3
with:
repository: J-Lich/Uncle-Fox-EPG
token: ${{ secrets.REPO_TOKEN }}
ref: main
path: uncle-fox-epg
- name: Copy XML file into Uncle-Fox-EPG repo
run: |
mkdir -p uncle-fox-epg/external/
cp tmp_epg/all.m3u uncle-fox-epg/external/all.m3u
- name: Commit and push XML file to Uncle-Fox-EPG
working-directory: uncle-fox-epg
run: |
git config --global user.name "actions-user"
git config --global user.email "actions@github.com"
git add external/all.m3u
git commit -m "Add new EPG XML file [CI skip]" || echo "No changes to commit"
git push