Update SPAM IP List #122
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 SPAM IP List | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Runs daily at midnight | |
workflow_dispatch: | |
jobs: | |
update-iplist: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Fetch IP List | |
run: | | |
curl -o abuseip.json https://raw.githubusercontent.com/borestad/blocklist-abuseipdb/main/abuseipdb-s100-14d.ipv4 | |
- name: Format IP List | |
run: | | |
jq -R -s -c 'split("\n") | map(select(test("^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")))' abuseip.json > tmp.json && mv tmp.json abuseip.json | |
- name: Commit changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add abuseip.json | |
git commit -m '[AUTO] Update spam IP list' | |
git push origin HEAD:${{ github.ref }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} |