Skip to content

Generate and Commit Root Zone #733

Generate and Commit Root Zone

Generate and Commit Root Zone #733

Workflow file for this run

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)