Update News Feed Daily #244
This file contains hidden or 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 News Feed Daily | |
| on: | |
| schedule: | |
| - cron: "0 20 * * *" # Currently set to 6 AM Australian EST (20:00 UTC the previous day) | |
| workflow_dispatch: # allows manually trigger if needed | |
| permissions: | |
| contents: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install dependencies | |
| run: | | |
| pip install feedparser | |
| - name: Run personalised news feed python script | |
| run: | | |
| python main.py | |
| - name: Commit and push changes if needed | |
| run: | | |
| git config user.name 'github-actions' | |
| git config user.email 'actions@github.com' | |
| git add index.html | |
| if git diff --cached --quiet; then | |
| echo "No changes to index.html β skipping commit." | |
| else | |
| git commit -m "π Auto-update news feed" | |
| git push | |
| fi |