Remove dead domains #22
This file contains hidden or 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: Remove dead domains | |
on: | |
workflow_dispatch: | |
# Every Saturday at 03:00 UTC or 10:00 at GMT+7 | |
schedule: | |
- cron: "0 3 * * 6" | |
permissions: | |
contents: write | |
jobs: | |
remove-dead-domains: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install PyFunceble | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyfunceble | |
- name: Check and remove dead domains | |
run: | | |
> pyfunceable-output.txt | |
> dead.txt | |
# pyfunceble -f /home/runner/work/anti-gambling-domains/anti-gambling-domains/domains.txt >> pyfunceable-output.txt | |
# rm -r /home/runner/work/anti-gambling-domains/anti-gambling-domains/output | |
grep -i "INACTIVE" /home/runner/work/anti-gambling-domains/anti-gambling-domains/pyfunceable-output.txt | awk '{print $1}' > /home/runner/work/anti-gambling-domains/anti-gambling-domains/dead.txt | |
grep -i "WHOIS" /home/runner/work/anti-gambling-domains/anti-gambling-domains/pyfunceable-output.txt | awk '{print $1}' > /home/runner/work/anti-gambling-domains/anti-gambling-domains/pre-dead.txt | |
grep -v -f dead.txt domains.txt > temp.txt && mv temp.txt domains.txt | |
- name: Commit and push changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Remove dead domains" | |
git push | |
continue-on-error: true | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |