Skip to content

Cleanup DNS Zones

Cleanup DNS Zones #235

name: "Cleanup DNS Zones"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup DNS Zones
env:
HETZNER_DNS_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }}
run: |
curl "https://dns.hetzner.com/api/v1/zones" -H "Auth-Api-Token: ${HETZNER_DNS_TOKEN}" -s | jq -r '.zones[] | .id' | xargs -I {} curl -XDELETE "https://dns.hetzner.com/api/v1/zones/{}" -H "Auth-Api-Token: ${HETZNER_DNS_TOKEN}"