Skip to content

Generate RSS Feed

Generate RSS Feed #42

Workflow file for this run

name: Generate RSS Feed
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *" # Runs daily at midnight UTC
permissions:
contents: write # Explicitly grant write permissions to the workflow
jobs:
generate-rss:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
# Step 3: Install dependencies
- name: Install dependencies
run: pip install requests xmltodict
# Step 4: Generate results.json
- name: Generate results.json
run: python generate_results.py
# Step 5: Generate RSS Feed
- name: Generate RSS Feed
run: python generate_rss_feed.py
# Step 6: Commit and push the generated files
- name: Commit and Push Changes
env:
TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add results.json rss_feed.xml
git commit -m "Update results.json and RSS feed [skip ci]" || echo "No changes to commit"
git push https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/robertheadley/Rss-Generator---Flipp.git