Generate and Commit RSS Feed #1859
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: Generate and Commit RSS Feed | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 */6 * * *" | |
jobs: | |
generate_rss_feed: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install beautifulsoup4 feedgen pytz requests | |
- name: Generate RSS Feed | |
run: python generate_rss.py | |
- name: Commit and Push Changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
git add latest.rss | |
git commit -m "Update RSS feed" | |
git push origin HEAD |