forked from bitwire-it/ipblocklist
-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (39 loc) · 1.1 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: update-list
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 */3 * * *" # UTC
jobs:
update-list:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
# DOWNLOAD GRAYNOISE IP LIST SSH, SSH WORM, IOT SCANNER and URLTABLE
- name: Setup wget
run: |
rm ip-list.txt
rm -rf blocklist
mkdir blocklist
wget -i urltable -P blocklist/ --wait 7
- name: Merge
run: |
cd blocklist
cat * >> output
sed -i 's/#.*//' output
sed -i 's/;.*//' output
sed -i 's/\[//g; s/\]//g' output
cat -n output | sort -uk2 | sort -nk1 | cut -f2- > ip-list.txt
cd ..
cp blocklist/ip-list.txt .
rm -rf blocklist
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply update-list changes