Skip to content

Update hosts

Update hosts #80

Workflow file for this run

name: Update hosts
on:
schedule:
# Every 48 hours at 00:00 UTC (days 1, 3, 5, … of each month)
- cron: '0 0 */2 * *'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: update-hosts
cancel-in-progress: false
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build blocklists
env:
DNS_WORKERS: "80"
DNS_MAX_PROBE: "50000"
VERIFIED_TTL_DAYS: "30"
run: python config/build_hosts.py
- name: Commit and push if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add hosts pihole-hosts dnscrypt-hosts config/dead config/verified
if git diff --staged --quiet; then
echo "No changes to blocklists; skipping commit."
exit 0
fi
git commit -m "chore: auto-update blocklists [skip ci]"
git push