Update RSS Feed #3504
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: Update RSS Feed | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 */4 * * *' # runs every 4 hours | |
jobs: | |
update-feed: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install feedparser jinja2 pytz beautifulsoup4 | |
- name: Fetch and Parse RSS Feed | |
run: python .github/scripts/rss_parser.py | |
- name: Commit and push if it changed | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git diff --quiet && git diff --staged --quiet || git commit -m 'Updated RSS Feed' | |
git push |