Update IP Blocks for Nigeria #4
This file contains 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 IP Blocks for Nigeria | |
on: | |
schedule: | |
- cron: '0 2 * * *' # Runs daily at 2 AM UTC | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
update-ip-blocks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
pip install requests PyGithub | |
- name: Run the update script | |
run: | | |
python ./update_ip_blocks_nigeria.py | |
continue-on-error: true | |
- name: Check if changes were made | |
run: | | |
if git diff --quiet; then | |
echo "No changes to commit." | |
else | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -m "Auto-update IP block list for Nigeria" | |
git push | |
fi |