Dig? Dig. #645
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: 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 |