-
Notifications
You must be signed in to change notification settings - Fork 359
executable file
·49 lines (45 loc) · 1.27 KB
/
update xbs.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
name: 香色闺阁
on:
schedule:
- cron: "0 10 */3 * *"
push:
branches: [ "shuyuan" ]
paths:
- 'xsreader/new/sources.json'
pull_request:
branches: [ "shuyuan" ]
paths:
- 'xsreader/new/sources.json'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: 安装依赖项
run: |
python -m pip install --upgrade pip
pip install requests pytz
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: 运行脚本
run: |
cd xsreader/new/python
python main.py
- name: 提交文件
run: |
git config user.email github-actions
git config user.name [email protected]
git add .
git commit -m "香色闺阁|自动更新" -a
git push
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
- name: Telegram通知
run: |
curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" \
-d "text=香色闺阁书源更新完成!分支:${{ github.ref }}"