42 lines
1010 B
YAML
42 lines
1010 B
YAML
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 和 push changes
|
|
run: |
|
|
git config --global user.email "yf_ff@sina.com"
|
|
git config --global user.name "lxhfans"
|
|
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
|