Skip to content

CI

CI #38

Workflow file for this run

name: CI
on:
schedule:
- cron: '0 */4 * * *'
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download IP list
run: wget -O ip.txt https://www.cloudflare-cn.com/ips-v4/#
- name: Make script executable
run: chmod +x CloudflareST
- name: TLS
run: ./CloudflareST -tp 443 -n 1000 -tlr 0 -cfcolo HKG
- name: convert_csv_to_tls
run: python convert_csv_to_tls.py
- name: notls
run: ./CloudflareST -tp 80 -n 1000 -tlr 0 -cfcolo HKG
- name: convert_csv_to_notls
run: python convert_csv_to_tls.py notls
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add *.txt
git commit -m "Update IP list"
git push
# 重试逻辑
if [ $? -ne 0 ]; then
echo "Commit and push failed, retrying..."
sleep 5 # 等待5秒后重试
git push
fi