Generate and Commit Root Zone #733
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: Generate and Commit Root Zone | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Run daily at midnight UTC | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| generate-and-commit: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Generate root zone file | |
| run: | | |
| mkdir -p dump | |
| TODAY=$(date +%Y-%m-%d) | |
| dig @b.root-servers.net . AXFR > dump/${TODAY}_root.zone | |
| - name: Commit and push if changed | |
| run: | | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git add dump | |
| git diff --quiet && git diff --staged --quiet || (git commit -m "Add root zone file for $(date +%Y-%m-%d)" && git push) |