-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (32 loc) · 1.32 KB
/
EPG.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
#################################################################################################
name: EPG
on:
schedule:
- cron: "15 */6 * * *"
workflow_dispatch:
defaults:
run:
shell: pwsh
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download & Retry
uses: nick-fields/retry@v2.8.2
with:
timeout_minutes: 2
max_attempts: 3
shell: pwsh
retry_on_exit_code: 1
retry_wait_seconds: 900
command: Invoke-RestMethod "http://${{ secrets.URL }}/xmltv.php?username=${{ secrets.USER }}&password=${{ secrets.PASS }}&output=ts" -OutFile "EPG.xml"
- name: Cleanup
run: |
(Get-Content "EPG.xml" -Raw) -Replace "${{ secrets.FIND }}", "${{ secrets.REPLACE }}" | Set-Content "EPG.xml"
(Get-Content "EPG.xml" -Raw) -Replace "${{ secrets.FIND2 }}", "${{ secrets.REPLACE2 }}" | Set-Content "EPG.xml"
- name: Commit changes (if needed)
run: |
git config --global user.name "${{ secrets.GIT_USER }}" && git config --global user.email "${{ secrets.GIT_EMAIL }}"
git add EPG.xml && git commit -m "Auto Update" && git push origin main
#################################################################################################