on: push: branches: - 'main' jobs: deploy_script: runs-on: linux_amd64 steps: - name: Apply zone changes shell: bash run: | CURRENT_ZONE= echo "Preparing to update ${{ vars.DNS_SERVER }}..." git clone ${{ gitea.server_url }}/${{ gitea.repository }} dns cd dns git diff HEAD^ HEAD > zone_diff.txt echo $(cat zone_diff.txt) while IFS= read -r line; do case "$line" in "--- "*".zone") CURRENT_ZONE=$(basename "$line" .zone | sed 's/--- //') ;; "--- "*) CURRENT_ZONE= ;; "+++"*) ;; "-"* | "+"*) if [ ! -z $CURRENT_ZONE ]; then if [[ $line == -* ]]; then # Enregistrement supprimé RECORD=$(echo "$line" | sed 's/^-//') echo "- $RECORD" # nsupdate -k $TSIG_KEY <