Skip to content

Update Daily Quote #166

Update Daily Quote

Update Daily Quote #166

Workflow file for this run

name: Update Daily Quote
on:
schedule:
- cron: "0 0 * * *" # Runs every day at midnight
workflow_dispatch: # Allows manual trigger
jobs:
update-readme:
runs-on: ubuntu-latest
permissions:
contents: write # Add explicit permissions
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install requests
- name: Run quote script
env:
API_NINJAS_KEY: ${{ secrets.API_NINJAS_KEY }}
run: python generate_quote.py
- name: Commit and push changes
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "Update daily quote" || echo "No changes to commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}