.github/workflows/EPG.yml #1692
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################################# | |
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/[email protected] | |
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 | |
################################################################################################# |