Update Country IP Blocks #168
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 Country IP Blocks | |
| on: | |
| schedule: | |
| - cron: "30 18 * * *" # Daily at 12:00 AM IST (18:30 UTC) | |
| workflow_dispatch: # Allows manual trigger for testing | |
| permissions: | |
| contents: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| pip install requests | |
| - name: Generate country IP blocks | |
| run: | | |
| python scripts/update_country_ip.py | |
| - 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 country/ | |
| git diff --cached --quiet || git commit -m "Daily update of country IP blocks $(date +'%Y-%m-%d')" | |
| git push |