Skip to content

Dangling DNS record check #20

Dangling DNS record check

Dangling DNS record check #20

name: Dangling DNS record check
on:
workflow_dispatch:
schedule:
- cron: '0 13 * * *'
permissions:
contents: read
jobs:
check-dns-records:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Get DNS records from Terraform
run: |
./bin/get-dns-records.sh ./terraform | sort | uniq > domains.txt
- name: Check DNS records
uses: maxneuvians/dns-hijack-check-action@main
- name: Notify if dangling records found
if: ${{ hashFiles('critical.json') != '' || hashFiles('potential.json') != '' }}
run: |
json='{"text":":dumpster-fire: Dangling DNS records found in `cds-snc/dns`: <https://github.com/cds-snc/dns/actions/workflows/dangling-dns-record.yml|view workflow>"}'
curl -X POST -H 'Content-type: application/json' --data "$json" ${{ secrets.SLACK_INTERNAL_SRE_ALERTS }}