update_iplists #548
This file contains hidden or 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_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 "noreply@github.actions.bot" | |
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/github-push-action@v0.8.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |