-
Notifications
You must be signed in to change notification settings - Fork 359
43 lines (37 loc) · 1.27 KB
/
uz.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
name: uz
on:
workflow_dispatch:
schedule:
- cron: "0 0 */1 * *"
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 bs4 pytz
- name: 运行脚本
run: python py/uz.py
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
- name: 提交文件
run: |
git config --local user.email "${{ secrets.USER_EMAIL }}"
git config --local user.name "${{ secrets.USER_NAME }}"
#echo "https://github.com/${{ github.repository }}:${{ secrets.REPO_TOKEN }}" > .git-credentials
git add .
git commit -m "uz" -a || true
git commit -m "Add new JSON files" || echo "No changes to commit"
git push
- name: Telegram通知
run: |
curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" \
-d "text=uz!分支:${{ github.ref }}"