-
Notifications
You must be signed in to change notification settings - Fork 9
40 lines (33 loc) · 1.08 KB
/
auto_update_xray_ip2.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
name: Auto Update Xray Config
on:
schedule:
- cron: '*/30 * * * *' # 每半小时自动运行(UTC时间)
workflow_dispatch: # 支持手动触发
jobs:
update-config:
runs-on: ubuntu-latest
steps:
# 拉取仓库代码
- name: Checkout Repository
uses: actions/checkout@v3
# 列出文件,确认路径
- name: List Files (Debugging Step)
run: |
ls -al backup/img/1/2/ip/xray/2/
# 设置 Python 环境
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
# 执行更新脚本
- name: Run Update Script
run: |
python backup/img/1/2/ip/xray/2/update_config.py
# 提交并推送更改
- name: Commit and Push Changes
run: |
git config --local user.name "github-actions"
git config --local user.email "[email protected]"
git add backup/img/1/2/ip/xray/2/config.json
git commit -m "Auto-update config.json: Increment domains" || echo "No changes to commit"
git push