Skip to content

test

test #4

name: Update Cloudflare Proxies
on:
push:
branches:
- feature/autoupdate-cf-proxy-list
schedule:
- cron: '0 0 1 * *' # runs at 00:00 UTC on the 1st day of every month
workflow_dispatch:
env:
IPV4_FILE: Common/config/cloudflare-ips-v4.txt
IPV6_FILE: Common/config/cloudflare-ips-v6.txt
jobs:
update-proxies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Fetch Cloudflare IPs and Update Files
env:
IPV4_URL: https://www.cloudflare.com/ips-v4
IPV6_URL: https://www.cloudflare.com/ips-v6
run: |
set -euo pipefail
echo "Fetching Cloudflare IP lists"
curl -s $IPV4_URL > $IPV4_FILE
curl -s $IPV6_URL > $IPV6_FILE
- name: Commit and Push Changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add ${{ env.IPV4_FILE }} ${{ env.IPV6_FILE }}
if git diff --cached --quiet; then
echo "No changes detected."
else
git commit -m "chore: Update Cloudflare proxy IP lists [auto-generated]"
git push
fi