-
-
Notifications
You must be signed in to change notification settings - Fork 26
88 lines (67 loc) · 2.28 KB
/
update-blocklists.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Update manually approved blocklists
on:
push:
branches:
- main
paths:
- '**.txt'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: main
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Prepare templates
run: node scripts/prepare-templates.js
- name: Remove duplicates from templates
run: node scripts/remove-duplicates.js
- name: Remove domains that are on the whitelist
run: node scripts/whitelist.js
- name: Set valid encoding
run: node scripts/set-valid-encoding.js
- name: Count domains
run: node scripts/update-number-of-domains.js
- name: Generate No IP list
run: node scripts/generate/noip.js
- name: Generate 0.0.0.0 list
run: node scripts/generate/0.0.0.0.js
- name: Generate 127.0.0.1 list
run: node scripts/generate/127.0.0.1.js
- name: Generate AdGuard list
run: node scripts/generate/adguard.js
- name: Generate Dnsmasq list
run: node scripts/generate/dnsmasq.js
- name: Generate RPZ list
run: node scripts/generate/rpz.js
- name: Generate list for Unbound
run: node scripts/generate/unbound.js
- name: Run git pull
run: git pull origin main
- name: Add files to staging
run: git add .
- name: Commit and push changes
run: |
git config user.name "Sefinek Actions"
git config user.email "[email protected]"
if [ -n "$(git status -s)" ]; then
MODIFIED_FILES=$(git diff --name-only HEAD | grep -v '^cache/')
FILE_COUNT=$(echo "$MODIFIED_FILES" | wc -l)
if [ "$FILE_COUNT" -gt 0 ]; then
git commit -am "Update previously committed blocklists in $GITHUB_SHA [$FILE_COUNT files]" -m "$MODIFIED_FILES"
git push origin main
else
echo "Canceled. No files to commit after excluding cache/ files."
fi
else
echo "Canceled. No changes to commit."
fi