更新 Clash/CloudflareCIDR.list #1001
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: 更新 Clash/CloudflareCIDR.list | |
on: | |
schedule: | |
- cron: '5 * */5 * *' | |
workflow_dispatch: # 允许手动触发 | |
jobs: | |
download-and-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' # 选择 Python 版本 | |
- name: Install requests library | |
run: | | |
pip install requests | |
- name: Download File | |
run: python CloudflareCIDR-main.py # 这里 CloudflareCIDR-main.py 处理文件 | |
- name: Commit and Push | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Downloaded file on $(date "+%Y/%m/%d %H:%M:%S")" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{github.repository}}.git | |
git push |