forked from jc-lw/youxuanyuming
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1011 Bytes
/
caijiip.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
name: Update IP List
on:
schedule:
- cron: '*/30 * * * *' # 每隔三十分钟运行一次
workflow_dispatch: # 手动触发
# push: # 允许提交触发
jobs:
update-ip-list:
runs-on: ubuntu-latest
steps:
- 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 requests
pip install beautifulsoup4
- name: Run script
run: python ${{ github.workspace }}/collect_ips.py
- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "jc-lw"
if [ -n "$(git status --porcelain)" ]; then
git add ip.txt
git commit -m "Automatic update"
git push
else
echo "No changes detected, skipping commit."
fi