Update Daily Quote #154
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 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 }} |