-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.31 KB
/
Copy pathmain.yml
File metadata and controls
57 lines (46 loc) · 1.31 KB
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
name: Dig? Dig.
on:
schedule:
- cron: '33 6 * * *' # Run at 06:33 UTC
workflow_dispatch:
jobs:
update-file:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Chmod
run: |
chmod +x ./clean-zone.sh
- name: Dig .nu
run: |
dig @zonedata.iis.se nu AXFR > nu.zone.txt
- name: Dig .se
run: |
dig @zonedata.iis.se se AXFR > se.zone.txt
- name: Prune .nu
run: |
./clean-zone.sh < nu.zone.txt > nu.zone.clean.txt
- name: Prune .se
run: |
./clean-zone.sh < se.zone.txt > se.zone.clean.txt
- name: Git status
id: check_changes
run: |
git_status=$(git status --porcelain)
if [ -z "$git_status" ]; then
echo "No changes to commit."
echo "::set-output name=changes::false"
else
echo "There are changes to commit."
echo "::set-output name=changes::true"
fi
- name: Git commit and push
if: steps.check_changes.outputs.changes == 'true'
run: |
git config --global user.name "kirilla"
git config --global user.email "jonas@kirilla.se"
git add nu.zone.clean.txt
git add se.zone.clean.txt
git commit -m "Fetch new DNS data"
git push