Fetch EPG #16
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: Fetch EPG | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Runs daily at midnight UTC | |
workflow_dispatch: # Allows manual trigger from the Actions tab | |
jobs: | |
fetch_epg_job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Download EPG file | |
run: | | |
curl -fSL "${{ secrets.EPG_URL }}" -o epg.xml | |
- name: Log the downloaded file details | |
run: | | |
if [ -f "epg.xml" ]; then | |
echo "EPG file downloaded successfully." | |
ls -lh epg.xml | |
else | |
echo "Failed to download the EPG file." | |
fi | |
- name: Commit and push the EPG file (Squash Commit) | |
run: | | |
git config --global user.name "actions-user" | |
git config --global user.email "[email protected]" | |
git add epg.xml | |
git commit -m "Update EPG file" | |
git push --force-with-lease | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |