trigger-airing #4575
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: Scheduled Update for Feed 0 | |
on: | |
repository_dispatch: | |
types: [trigger-airing] | |
jobs: | |
update-feed-0: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
pip install requests pytz | |
- name: Delay for 5 minutes | |
run: sleep 300 # 300 seconds is 5 minutes | |
- name: Run update script for Feed 0 | |
run: python toshofeed.py 0 1 1 | |
- name: Commit and push changes | |
env: | |
GH_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
git add rssfeed/*.xml | |
git commit -m "Scheduled update for Feed 0" || echo "No changes to commit" | |
git pull origin main --rebase | |
git push https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git | |
- name: Trigger Feed 1 Update Workflow | |
run: | | |
curl -X POST -H "Accept: application/vnd.github.everest-preview+json" \ | |
-H "Authorization: token ${{ secrets.GH_PAT }}" \ | |
https://api.github.com/repos/${{ github.repository }}/dispatches \ | |
-d '{"event_type":"trigger-airing-1"}' |