Skip to content

Commit

Permalink
Generate adguard blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
szinn committed May 23, 2024
1 parent eea5bfc commit 32671a3
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/create-blacklist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
run: |
HOSTS_FILE="/tmp/hosts.blacklist"
destination="hosts.blacklist"
destination_adguard="hosts-adguard.blacklist"
HOSTS_FILES="$HOSTS_FILE.d"
mkdir -p "${HOSTS_FILES}"
Expand Down Expand Up @@ -84,14 +85,15 @@ jobs:
-e '/^.com$/d' \
-e '/^localhost$/d' \
-e '/^MalvertisinglistbyDisconnect$/d' \
-e '/^$/d' \
-e 's/^/0.0.0.0 /g' | \
-e '/^$/d' | \
awk '!a[$0]++' | sort -u > "${HOSTS_FILE}"
cat "${HOSTS_FILE}" | sed -e 's/^/0.0.0.0 /g' > "${destination}"
cat "${HOSTS_FILE}" | sed -e 's/^/||/g' > "${destination_adguard}"
rm -rf "${HOSTS_FILES}"
mv "${HOSTS_FILE}" "${destination}"
ls -l ${destination}
ls -l ${destination} ${destination_adguard}
- name: Upload blacklist
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
Expand All @@ -103,3 +105,14 @@ jobs:
tag: pi-hole
overwrite: true
body: "Current blacklisted sites"

- name: Upload adguard blacklist
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
with:
release_name: "AdGuard Blacklist"
repo_token: ${{ steps.app-token.outputs.token }}
file: hosts-adguard.blacklist
asset_name: hosts-adguard.blacklist
tag: adguard
overwrite: true
body: "Current AdGuard blacklisted sites"

0 comments on commit 32671a3

Please sign in to comment.