TOOLS: publish filters on git pages
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
name: Update Filters
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 3 */2 * *" # every 2 days at 03:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout main branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
|
||||
- name: Prepare output directory
|
||||
run: mkdir -p out/filters
|
||||
|
||||
- name: Download filter lists (fail-safe)
|
||||
run: |
|
||||
set -e
|
||||
KO=0
|
||||
|
||||
# Read each URL from the sources file
|
||||
while IFS= read -r line; do
|
||||
[ -z "$line" ] && continue
|
||||
|
||||
url=$(echo "$line" | cut -d '=' -f1 | xargs)
|
||||
file=$(echo "$line" | cut -d '=' -f2 | xargs)
|
||||
|
||||
# fallback: if no filename provided, use basename
|
||||
if [ -z "$file" ]; then
|
||||
file=$(basename "$url")
|
||||
fi
|
||||
|
||||
echo "Downloading $url -> $file"
|
||||
|
||||
if ! curl -fL "$url" -o "out/filters/$file"; then
|
||||
echo "FAILED: $url"
|
||||
KO=1
|
||||
fi
|
||||
done < tools/images/update-cromite-org/filters-sources.txt
|
||||
|
||||
# Abort deployment if any download failed
|
||||
if [ "$KO" -ne 0 ]; then
|
||||
echo "One or more downloads failed. Aborting deploy."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Checkout gh-pages branch
|
||||
if: success()
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: pages
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Deploy to gh-pages
|
||||
if: success()
|
||||
run: |
|
||||
# Replace old filters with new ones
|
||||
rm -rf filters
|
||||
mkdir -p filters
|
||||
cp -r out/filters/* filters/
|
||||
|
||||
git config user.name "github-actions"
|
||||
git config user.email "github-actions@github.com"
|
||||
|
||||
git add filters/*.txt
|
||||
|
||||
# Skip commit if nothing changed
|
||||
if git diff --cached --quiet; then
|
||||
echo "No changes detected"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git commit -m "Update filters ($(date -u))"
|
||||
git push origin gh-pages
|
||||
@@ -0,0 +1,56 @@
|
||||
https://badblock.celenity.dev/abp/badblock_lite.txt = badblock_lite.txt
|
||||
https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt = abp-filters-anti-cv.txt
|
||||
https://easylist-downloads.adblockplus.org/abpindo+easylist.txt = abpindo+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/abpindo.txt = abpindo.txt
|
||||
https://easylist-downloads.adblockplus.org/abpvn+easylist.txt = abpvn+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/abpvn.txt = abpvn.txt
|
||||
https://easylist-downloads.adblockplus.org/bulgarian_list+easylist.txt = bulgarian_list+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/bulgarian_list.txt = bulgarian_list.txt
|
||||
https://easylist-downloads.adblockplus.org/dandelion_sprouts_nordic_filters+easylist.txt = dandelion_sprouts_nordic_filters+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/dandelion_sprouts_nordic_filters.txt = dandelion_sprouts_nordic_filters.txt
|
||||
https://easylist-downloads.adblockplus.org/easylist.txt = easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt = easylistchina+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistchina.txt = easylistchina.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistczechslovak+easylist.txt = easylistczechslovak+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistczechslovak.txt = easylistczechslovak.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistdutch+easylist.txt = easylistdutch+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistdutch.txt = easylistdutch.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt = easylistgermany+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistgermany.txt = easylistgermany.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistitaly+easylist.txt = easylistitaly+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistitaly.txt = easylistitaly.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistlithuania+easylist.txt = easylistlithuania+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistlithuania.txt = easylistlithuania.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistpolish+easylist.txt = easylistpolish+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistpolish.txt = easylistpolish.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistportuguese+easylist.txt = easylistportuguese+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistportuguese.txt = easylistportuguese.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistspanish+easylist.txt = easylistspanish+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/easylistspanish.txt = easylistspanish.txt
|
||||
https://easylist-downloads.adblockplus.org/fanboy-notifications.txt = fanboy-notifications.txt
|
||||
https://easylist-downloads.adblockplus.org/fanboy-social.txt = fanboy-social.txt
|
||||
https://easylist-downloads.adblockplus.org/global-filters+easylist.txt = global-filters+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/global-filters.txt = global-filters.txt
|
||||
https://easylist-downloads.adblockplus.org/hufilter.txt = hufilter.txt
|
||||
https://easylist-downloads.adblockplus.org/i_dont_care_about_cookies.txt = i_dont_care_about_cookies.txt
|
||||
https://easylist-downloads.adblockplus.org/indianlist+easylist.txt = indianlist+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/indianlist.txt = indianlist.txt
|
||||
https://easylist-downloads.adblockplus.org/israellist+easylist.txt = israellist+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/israellist.txt = israellist.txt
|
||||
https://easylist-downloads.adblockplus.org/japanese-filters+easylist.txt = japanese-filters+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/japanese-filters.txt = japanese-filters.txt
|
||||
https://easylist-downloads.adblockplus.org/koreanlist+easylist.txt = koreanlist+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/koreanlist.txt = koreanlist.txt
|
||||
https://easylist-downloads.adblockplus.org/latvianlist+easylist.txt = latvianlist+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/latvianlist.txt = latvianlist.txt
|
||||
https://easylist-downloads.adblockplus.org/liste_ar+liste_fr+easylist.txt = liste_ar+liste_fr+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/liste_ar.txt = liste_ar.txt
|
||||
https://easylist-downloads.adblockplus.org/liste_fr+easylist.txt = liste_fr+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/liste_fr.txt = liste_fr.txt
|
||||
https://easylist-downloads.adblockplus.org/rolist+easylist.txt = rolist+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/rolist.txt = rolist.txt
|
||||
https://easylist-downloads.adblockplus.org/ruadlist+easylist.txt = ruadlist+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/ruadlist.txt = ruadlist.txt
|
||||
https://easylist-downloads.adblockplus.org/turkish-filters+easylist.txt = turkish-filters+easylist.txt
|
||||
https://easylist-downloads.adblockplus.org/turkish-filters.txt = turkish-filters.txt
|
||||
https://raw.githubusercontent.com/badmojr/1Hosts/master/Lite/adblock.txt = badmojr-1Hosts-master-Lite-adblock.txt
|
||||
Reference in New Issue
Block a user