Skip to content

Update Fail2Ban banned IPs #19

Update Fail2Ban banned IPs

Update Fail2Ban banned IPs #19

Workflow file for this run

name: Update Fail2Ban banned IPs
on:
schedule:
- cron: '*/30 * * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
update-banned:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PUSH_PAT }}
path: malicious_ips
- name: Run update script
run: bash ~/script.sh
- name: Commit and push updated IP list
working-directory: malicious_ips
run: |
git add malicious_ips.txt
if git diff --staged --quiet; then
echo "Nothing to update."
exit 0
fi
git config user.name 'nixbear-actions'
git config user.email ${{ secrets.GH_EMAIL }}
git commit -m "Update banned IPs $(date -u +'%Y-%m-%d %H:%M:%S UTC')"
git push