Skip to content

Commit b41cd02

Browse files
authored
Create update_quote.yml
1 parent cc16b58 commit b41cd02

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/update_quote.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Update Daily Quote
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *" # Runs every day at midnight
6+
workflow_dispatch: # Allows manual trigger
7+
8+
jobs:
9+
update-readme:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.x'
19+
20+
- name: Install requests library
21+
run: |
22+
pip install requests
23+
24+
- name: Run quote script
25+
run: python generate_quote.py
26+
27+
- name: Commit and push changes
28+
run: |
29+
git config --local user.name "github-actions[bot]"
30+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
31+
git add README.md
32+
git commit -m "Update daily quote"
33+
git push
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)