File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 7
7
continue-on-error : true
8
8
steps :
9
9
- uses : actions/checkout@v2
10
+ - run : |
11
+ git config --global user.name 'github-actions[bot]'
12
+ git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
10
13
name: Python setup
11
14
- uses : actions/setup-python@v2
12
15
with :
17
20
run : |
18
21
cd scripts
19
22
python3 dnscheck.py
23
+ - name : Commit updated pihole-google.txt
24
+ run : |
25
+ git add pihole-google.txt && git commit -am "Remove domains without NS records"
26
+ git push
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ def check_domain(domain):
15
15
16
16
def main ():
17
17
found_domains = 0
18
+ domains_with_ns_records = []
18
19
19
20
with open ("../pihole-google.txt" ) as f :
20
21
for line in f :
@@ -23,6 +24,12 @@ def main():
23
24
if check_domain (domain ):
24
25
print (f"Domain without NS records: { domain } " )
25
26
found_domains += 1
27
+ else :
28
+ domains_with_ns_records .append (line )
29
+
30
+ # Write remaining domains back to the file
31
+ with open ("../pihole-google.txt" , "w" ) as f :
32
+ f .writelines (domains_with_ns_records )
26
33
27
34
if found_domains > 0 :
28
35
sys .exit (1 )
You can’t perform that action at this time.
0 commit comments