-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (37 loc) · 1.05 KB
/
main.yml
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
41
42
43
44
name: Update README
on:
# 当代码被提交到 main 分支时触发
push:
branches:
- main
# 定时任务,每周五晚上 12 点触发
schedule:
- cron: '0 0 * * 5' # UTC 时间,每周五 00:00
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Setup Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
# Step 3: Install dependencies
- name: Install dependencies
run: pip install -r requirements.txt
# Step 4: Run the script to update README.md
- name: Update README.md
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
run: python main.py
# Step 5: Commit and push changes
- name: Commit and push changes
run: |
git config --local user.name "snjyor"
git config --local user.email "snjyor@163.com"
git add README.md
git commit -m "Update README.md"
git push origin main