Skip to content

refresh-resolvers #1529

refresh-resolvers

refresh-resolvers #1529

name: refresh-resolvers
on:
workflow_dispatch:
schedule:
# Run every 12h
- cron: '30 */12 * * *'
jobs:
resfresh-list:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout DNS Validator
uses: actions/checkout@v2
with:
repository: 'vortexau/dnsvalidator'
path: dnsvalidator
- name: Install DNS Validator
run: |
cd dnsvalidator
python3 setup.py install
- name: Install contextvars
run: pip3 install contextvars
# It needs to be done because the current 6 hours limit for
# the Github actions is not sufficient to check all of them
- name: Get the resolvers list and trim it
run: curl -LO https://public-dns.info/nameservers.txt && head -n 20000 nameservers.txt > raw-resolvers.txt
- name: Generate new resolvers
run: dnsvalidator -tL ./raw-resolvers.txt -threads 30 --silent > ~/resolvers.txt
# Enable tmate debugging of manually-triggered workflows if the input option was provided
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Set current date
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Commit changes
run: |
mv ~/resolvers.txt .
git config --local user.email "[email protected]"
git config --local user.name "Edu4rdSHL"
git add resolvers.txt
git commit -m "${NOW} update."
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
- uses: gautamkrishnar/keepalive-workflow@v1