Skip to content

Refresh AbuseIPDB List #528

Refresh AbuseIPDB List

Refresh AbuseIPDB List #528

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Refresh AbuseIPDB List
# Controls when the workflow will run
on:
schedule:
- cron: "10 12 * * *"
# Triggers the workflow on push or pull request events but only for the "main" branch
#push:
#branches: [ "main" ]
#pull_request:
#branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Runs a single command using the runners shell
- name: Fetch data and save to JSON
run: curl -G 'https://api.abuseipdb.com/api/v2/blacklist' -d confidenceMinimum=90 -H 'Key:62c97cc651c020c8183d48049bcec43f085643fa0c0725c3cbd34ea42803233cc1e3933c6c1790ed' -H 'Accept:application/json' > abuseipdb_blacklist_unfiltered.json
- name: Keep useful fields
run: cat abuseipdb_blacklist_unfiltered.json | jq -r '[.data[] | {ipAddress:.ipAddress, countryCode:.countryCode, abuseConfidenceScore:.abuseConfidenceScore, lastReportedAt:.lastReportedAt}] | @json' > abuseipdb_blacklist.json
# Runs a set of commands using the runners shell
- name: Head the JSON to confirm
run: echo -e 'abuseipdb_blacklist.json -->' && head abuseipdb_blacklist.json
- name: Commit files # commit the output folder
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action test"
git add ./abuseipdb_blacklist.json
git commit -m "Add changes"
- name: Push changes # push the output folder to your repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main