Download and generate blocklists #1729
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: Download and generate blocklists | |
on: | |
schedule: # https://crontab.guru | |
# - cron: '0 */5 * * *' # At minute 0 past every 5th hour. | |
# - cron: '0 * * * *' # At minute 0. | |
- 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 | |
- name: Download blocklists | |
run: bash bash/download.sh | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Run npm install | |
run: npm install | |
- name: Prepare templates | |
run: node scripts/prepare-templates.js | |
- name: Remove duplicates | |
run: node scripts/remove-duplicates.js | |
- name: Lint | |
run: node scripts/lint.js | |
# - 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: Count domains | |
run: node scripts/update-number-of-domains.js --ignore-question | |
- name: Commit files | |
run: | | |
git config --global user.name "Sefinek Actions" | |
git config --global user.email "[email protected]" | |
git add . | |
if [ -n "$(git status -s)" ]; then | |
git status | |
git commit -m "Download blocklists and update files" | |
git push | |
else | |
echo "No changes to commit" | |
fi |