Update IP List #2187
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "yizgolden" | |
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 |