Skip to content

Download and generate blocklists #4516

Download and generate blocklists

Download and generate blocklists #4516

---
name: Download and generate blocklists
on:
schedule: # https://crontab.guru
- cron: '0 */2 * * *' # At minute 0 past every 2nd hour.
workflow_dispatch:
jobs:
download:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
# lfs: true
# - name: Set up Git LFS
# run: git lfs install
- name: Download blocklists
run: bash bash/download.sh
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Prepare templates
run: node scripts/prepare-templates.js
- name: Remove duplicates
run: node scripts/prepare-lines.js
- name: Remove domains that are on the whitelist
run: node scripts/whitelist.js
# - name: Sort templates
# run: node scripts/sort-templates.js
- name: Set valid encoding
run: node scripts/set-valid-encoding.js
- name: Lint
run: node scripts/lint.js
- name: Count domains
run: node scripts/update-number-of-domains.js --ignore-question
# - name: Create everything list
# run: node scripts/create-everything-list.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: Track large files
# run: |
# find . -type f \( -name "*.txt" -o -name "*.conf" \) -size +50M | xargs -I {} git lfs track "{}"
# git add .gitattributes
- name: Add files to staging
run: git add .
- name: Commit and push changes
run: |
git config --global user.name "Sefinek Actions"
git config --global user.email "[email protected]"
if [ -n "$(git status -s)" ]; then
git status
git commit -m "Download blocklists and update files"
git push origin main
else
echo "Canceled. No changes to commit."
fi
env:
GITHUB_TOKEN: ${{ secrets.SEFINEK_ACTIONS_PAT }}