-
Notifications
You must be signed in to change notification settings - Fork 61
43 lines (33 loc) · 960 Bytes
/
update_AdBlock.yaml
File metadata and controls
43 lines (33 loc) · 960 Bytes
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: Update AdBlock Rule
on:
schedule:
# 北京时间每天凌晨 4 点 (UTC 20:00)
- cron: '0 20 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install requests pyyaml
- name: Run merge script
run: |
python merge_rules.py
- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# 强制添加生成的 AdBlock.yaml 文件
git add Egern/Rule/AdBlock.yaml
# 提交更改 (如果文件无变化则跳过)
git commit -m "Auto-update: Egern/Rule/AdBlock.yaml" || exit 0
git push