-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (43 loc) · 1.34 KB
/
Copy pathfetch.yml
File metadata and controls
51 lines (43 loc) · 1.34 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
48
49
50
51
name: MetaFetch Fetch Update
on:
push:
branches:
- master
schedule:
- cron: '0 */3 * * *' # 每 3 小时运行一次
workflow_dispatch: # 支持手动触发
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
env:
TZ: Asia/Shanghai
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Fetch Task
env:
PRIVATE_SOURCES: ${{ secrets.PRIVATE_SOURCES }}
run: |
python main.py
- name: Commit and Push Changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add list.meta.yml list.singbox.json list.b64 list.txt README.md
git diff --quiet && git diff --staged --quiet || (git commit -m "Auto Update: $(date +'%Y-%m-%d %H:%M:%S')" && git push)
- name: Send Telegram Notification
env:
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
TG_CHAT_ID: ${{ secrets.TG_CHAT_ID }}
run: |
python utils/notify.py