-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 2.12 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Daily Script
on:
# push:
# branches: [ main ]
schedule:
- cron: '05 16 * * *' # UTC 时间 16:05 北京时间大约 00:05
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup timezone # https://github.com/marketplace/actions/setup-timezone
uses: zcong1993/setup-timezone@master
with:
timezone: Asia/Shanghai
- name: Check out repo
uses: actions/checkout@v2
- name: Set up Python 3.11 # https://github.com/actions/setup-python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'pip'
cache-dependency-path: '**/requirements.txt'
- name: Install requirements dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Update zhihu
run: |
python zhihu.py
# - name: Update bilibili
# run: |
# python bilibili.py ${{ secrets.BILIBILI_SESSDATA }}
- name: Commit
run: |
git diff
git config --global user.email [email protected]
git config --global user.name lmmsoft
git add .
#git commit -m"action:`date +'%Y-%m-%d'`"
git commit -m "Action: `date +'%Y-%m-%d %H:%M %z %Z'`"
git pull --rebase
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.ACTION_TOKEN }}
- name: Send Feishu text message # https://github.com/marketplace/actions/feishu-bot-action
uses: foxundermoon/feishu-action@v2 # 上下文 https://docs.github.com/en/actions/learn-github-actions/contexts
with:
url: ${{ secrets.FEISHU_BOT_WEBHOOK_URL }}
msg_type: text
content: |
text: |
workflow: ${{ github.workflow }}
repository: ${{ github.repository }}
committer: ${{ github.actor }}
compare: ${{ github.event.compare }}
job status: ${{ job.status }}