-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (34 loc) · 1.08 KB
/
convert_and_push.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
name: Scheduled Update
on:
schedule:
- cron: '0 0 * * *' # 每天UTC时间0点运行
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Checkout upstream repository
uses: actions/checkout@v4
with:
repository: privacy-protection-tools/anti-AD
ref: master # 或者指定其他分支
path: code # 指定克隆到的工作目录路径
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: pip install requests
- name: Run conversion script
run: python ./convert_ros_dns_adlist.py
- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add anti-ad-for-ros.conf
git commit -m "Scheduled update" || exit 0
git push
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: '.'