-
Notifications
You must be signed in to change notification settings - Fork 5
40 lines (33 loc) · 1.08 KB
/
Copy pathupdate_quote.yml
File metadata and controls
40 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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 }}