-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (34 loc) · 1.09 KB
/
action.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
name: 'GitHub LeetCode Bot'
on:
# 执行git push操作将会触发此脚本
push:
# 每隔12小时将会触发此脚本
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
jobs:
bot:
runs-on: ubuntu-latest
steps:
# 检测代码
- name: 'Checkout codes'
uses: actions/checkout@v2
# 修改系统时区
- name: Setup the time zone to Asia/Shanghai
uses: zcong1993/setup-timezone@master
with:
timezone: Asia/Shanghai
# 安装requirements.txt中的依赖包
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if: steps.pip-cache.outputs.cache-hit != 'true'
# 运行leetcode.py文件
# 将在程序当前生成目录下生成一个新的README.md文件
- name: Get LeetCode Data
run: python leetcode.py ${{ secrets.LEETCODE_SESSION }}
# 执行push操作,推送最新的README.md文件
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update changes