-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 2.16 KB
/
Copy pathepg_merge.yml
File metadata and controls
72 lines (61 loc) · 2.16 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
name: channels-epg-merge
on:
schedule:
- cron: '5 */12 * * *'
workflow_dispatch:
jobs:
backup-and-merge:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Run backup and merge
run: cd epgs && python backup_and_merge.py
- name: Commit and push changes
run: |
git config --global user.name "actions-user"
git config --global user.email "actions@github.com"
git add epgs/daddylive-channels-epg_z1.xml epgs/daddylive-channels-epg_z2.xml epgs/daddylive-channels-epg_z3.xml epgs/guide.xml
git diff --staged --quiet || git commit -m "Update channels epg"
git push --force
push-to-uncle-fox-epg:
needs: backup-and-merge
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 epgs/daddylive-channels-epg.xml tmp_epg/single.xml
cp epgs/guide.xml tmp_epg/guide.xml
- 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/single.xml uncle-fox-epg/external/single.xml
cp tmp_epg/guide.xml uncle-fox-epg/external/guide.xml
- 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/single.xml external/guide.xml
git commit -m "Add new EPG XML file [CI skip]" || echo "No changes to commit"
git push