Skip to content

Update YMHC domains

Update YMHC domains #3

name: Zone File Validation
# Trigger the workflow on pull requests that modify the db.ngo.us file
on:
pull_request:
paths:
- 'db.ngo.us'
jobs:
check-zonefile:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository code
- name: Checkout Code
uses: actions/checkout@v3
# Step 2: Install BIND utilities (which include named-checkzone)
- name: Install BIND Utilities
run: sudo apt-get update && sudo apt-get install -y bind9-utils
# Step 3: Run named-checkzone to validate the zone file
- name: Validate Zone File
run: |
ZONE_FILE="db.ngo.us"
ZONE_NAME="ngo.us"
TEMP_ZONE_FILE="temp_$ZONE_FILE"
# Step 3a: Replace placeholder 'YYYYMMDDNN' with a dummy value in a temporary file
sed 's/YYYYMMDDNN/1900010101/g' $ZONE_FILE > $TEMP_ZONE_FILE
# Step 3b: Run named-checkzone to validate the modified zone file
named-checkzone $ZONE_NAME $TEMP_ZONE_FILE || { echo "Zone file validation failed!"; exit 1; }
# Clean up
rm $TEMP_ZONE_FILE