Skip to content

update_iplists

update_iplists #147

name: update_iplists
on:
schedule:
- cron: "0 08 * * *" # 8:00 AM Coordinated Universal Time (UTC) / 12:00 AM Pacific Time (PT)
- cron: "0 20 * * *" # 8:00 PM Coordinated Universal Time (UTC) / 12:00 PM Pacific Time (PT)
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone Project
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Python Packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Execute update_iplists.py Script
run: python cloudflare_ips.py
- name: Commit .rsc Files
run: |
#!/bin/bash
NOW=$(date +"%m-%d-%Y %H:%M:%S PT")
if ! grep -q "error" "cloudflare-ips-v4.rsc" && ! grep -q "error" "cloudflare-ips-v6.rsc"; then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add cloudflare-ips-v*
git status
git commit -m "Run automations and generate fresh lists - $NOW"
fi
- name: Push Changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main