SystemJargon Filters - Lists Compiler and Updater #870
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SystemJargon Filters - Lists Compiler and Updater | |
on: | |
schedule: | |
- cron: '0 1 * * *' | |
# workflow_dispatch: | |
# push: | |
# branches: | |
# - main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- uses: actions/setup-node@main | |
with: | |
node-version: '16' | |
- run: npm i -g @adguard/hostlist-compiler | |
# Lists input and output | |
- name: Compile Threats list | |
run: hostlist-compiler -c ./source/threats.json -o threats.txt | |
- name: Compile Ads list | |
run: hostlist-compiler -c ./source/ads.json -o ads.txt | |
- name: Compile Core Normal list | |
run: hostlist-compiler -c ./source/core.json -o core.txt | |
- name: Compile Core Light list | |
run: hostlist-compiler -c ./source/core_light.json -o core_light.txt | |
- name: Compile Core Heavy list | |
run: hostlist-compiler -c ./source/core_heavy.json -o core_heavy.txt | |
- name: Compile Porn list | |
run: hostlist-compiler -c ./source/porn.json -o porn.txt | |
- name: Compile BigDargon list | |
run: hostlist-compiler -c ./source/hostsvn.json -o hostsvn.txt | |
- name: Compile Telemetry list | |
run: hostlist-compiler -c ./source/telemetry.json -o telemetry.txt | |
- name: Compile Firebog Ticklist | |
run: hostlist-compiler -c ./source/firebog-ticklist.json -o firebog-ticklist.txt | |
# - name: Compile Allow list | |
# run: hostlist-compiler -c ./source/allowlist.json -o allowlist.txt | |
- name: Compile Restrict-ByPass list | |
run: hostlist-compiler -c ./source/restrict-bypass.json -o restrict-bypass.txt | |
- name: Compile Newly Registered Domains 30 Day list | |
run: hostlist-compiler -c ./source/nrds-30days.json -o nrds-30days.txt | |
- name: Compile No Social Media list | |
run: hostlist-compiler -c ./source/no-social-media.json -o no-social-media.txt | |
- name: Update Restrict ByPass and No-Social-Media User_Child Lists | |
run: | | |
cat restrict-bypass.txt | sed "s/\^$/\^\$ctag=user_child/g" > restrict-bypass-user_child.txt | |
cat no-social-media.txt | sed "s/\^$/\^\$ctag=user_child/g" > no-social-media-user_child.txt | |
- name: Clean Previous Stats | |
run: rm -f ./stats/list-entries-stats.txt | |
- name: Count lines in lists | |
run: | | |
grep -vE '^[#!]' ads.txt | wc -l > ./stats/ads_count.txt | |
grep -vE '^[#!]' allowlist.txt | wc -l > ./stats/allowlist_count.txt | |
grep -vE '^[#!]' core.txt | wc -l > ./stats/core_count.txt | |
grep -vE '^[#!]' core_heavy.txt | wc -l > ./stats/core_heavy_count.txt | |
grep -vE '^[#!]' core_light.txt | wc -l > ./stats/core_light_count.txt | |
grep -vE '^[#!]' firebog-ticklist.txt | wc -l > ./stats/firebog-ticklist_count.txt | |
grep -vE '^[#!]' hostsvn.txt | wc -l > ./stats/hostsvn_count.txt | |
grep -vE '^[#!]' no-social-media.txt | wc -l > ./stats/no-social-media_count.txt | |
grep -vE '^[#!]' nrds-30days.txt | wc -l > ./stats/nrds-30days_count.txt | |
grep -vE '^[#!]' porn.txt | wc -l > ./stats/porn_count.txt | |
grep -vE '^[#!]' restrict-bypass.txt | wc -l > ./stats/restrict-bypass_count.txt | |
grep -vE '^[#!]' threats.txt | wc -l > ./stats/threats_count.txt | |
grep -vE '^[#!]' telemetry.txt | wc -l > ./stats/telemetry_count.txt | |
- name: Create Stats Report | |
run: | | |
echo "Entries per list:" > ./stats/list-entries-stats.txt | |
echo "Ads: $(cat ./stats/ads_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "Allowlist: $(cat ./stats/allowlist_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "Core: $(cat ./stats/core_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "Core Heavy: $(cat ./stats/core_heavy_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "Core Light: $(cat ./stats/core_light_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "Firebog Ticklist: $(cat ./stats/firebog-ticklist_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "Host SVN: $(cat ./stats/hostsvn_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "No Social Media: $(cat ./stats/no-social-media_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "NRDS 30 Days: $(cat ./stats/nrds-30days_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "Porn: $(cat ./stats/porn_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "Restrict Bypass: $(cat ./stats/restrict-bypass_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "Threats: $(cat ./stats/threats_count.txt)" >> ./stats/list-entries-stats.txt | |
echo "Telemetry: $(cat ./stats/telemetry_count.txt)" >> ./stats/list-entries-stats.txt | |
rm ./stats/*_count.txt | |
- name: Start commit change | |
run: echo "MSG=Updated at $(date +"%Y%m%d")" >> $GITHUB_ENV | |
- name: Commit changes | |
uses: EndBug/add-and-commit@main | |
with: | |
default_author: github_actions | |
message: ${{ env.MSG }} |