-
Notifications
You must be signed in to change notification settings - Fork 42
47 lines (39 loc) · 1.21 KB
/
Copy pathauto-update.yml
File metadata and controls
47 lines (39 loc) · 1.21 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
41
42
43
44
45
46
47
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Auto update
on:
push:
branches: [ main ]
schedule:
- cron: '5 3 * * *'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # 允许推送代码
packages: read # 允许读取包
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Auto Update
run: |
echo "auto update start" >> ranking.log
> ranking.log
sh auto_run.sh ${{ secrets.GITHUB_TOKEN }} >> ranking.log
echo "auto update end" >> ranking.log
- name: Commit
run: |
echo "commit&push start" >> ranking.log
git config --global user.email uxiaopeng@gmail.com
git config --global user.name yuxiaopeng
git add .
git commit -m"action:`date`"
git push
echo "commit&push end" >> ranking.log