-
Notifications
You must be signed in to change notification settings - Fork 26
60 lines (50 loc) · 2.25 KB
/
findredundant.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Find Redundant Domains
on:
workflow_dispatch:
schedule:
- cron: "20 23 * * *"
env:
RELEASE_NAME: $(date +%Y%m%d%H%M)
jobs:
check-domains:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install csvkit
- name: Get Check-Domains script
run: curl -sSLO https://raw.githubusercontent.com/Chocolate4U/Domain-Health-Checker/main/Check-Domains.ps1
- name: Get domains
run: curl -sSL https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/domains.txt | grep -Ev ".+\.ir$" | sort -u > domains.txt
- name: Check Domains with Cloudflare
shell: pwsh
run: |
.\Check-Domains.ps1 -Mode DOH -DOHServer Cloudflare -Http3 -Concurrency 100 -Quiet
New-Item -Name "Cloudflare" -ItemType "directory"
Move-Item -Path "./Results-DOH.csv" -Destination "./Cloudflare"
- name: Check Domains with Google
shell: pwsh
run: |
.\Check-Domains.ps1 -Mode DOH -DOHServer Google -Http3 -Concurrency 100 -Quiet
New-Item -Name "Google" -ItemType "directory"
Move-Item -Path "./Results-DOH.csv" -Destination "./Google"
- name: Generate final result
run: |
csvgrep -c 2 -m "DEAD" ./Cloudflare/Results-DOH.csv | awk -F"," '{print $1}' | sed '1d' | sort -u > redundant-cloudflare.txt
csvgrep -c 2 -m "DEAD" ./Google/Results-DOH.csv | awk -F"," '{print $1}' | sed '1d' | sort -u > redundant-google.txt
comm -12 redundant-cloudflare.txt redundant-google.txt > redundant-domains.txt
- name: Push result to redundant branch
run: |
mkdir redundant
cp redundant-domains.txt redundant
cd redundant || exit 1
git init
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b redundant
git add .
git commit -m "${{ env.RELEASE_NAME }}"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f origin redundant