Skip to content

Check hosted zone changes INSYNC #33

Check hosted zone changes INSYNC

Check hosted zone changes INSYNC #33

name: Check Change Status
on:
pull_request:
workflow_dispatch:
push:
# paths:
# - "hostedzones/**"
# - "config.yaml"
branches:
- main
# want this to be triggered by successful completion of OctoDNS Sync workflow
jobs:
check-change-status:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
make install
- name: Get hosted zone changed files
id: hosted-zone-changed-files
uses: tj-actions/changed-files@40853de9f8ce2d6cfdc73c1b96f14e22ba44aec4 # v45.0.0
with:
files: |
hostedzones/**
- name: Set hosted zone changed files environment variable
env:
HOSTED_ZONE_CHANGED_FILES: ${{ steps.hosted-zone-changed-files.outputs.all_changed_files }}
if: steps.hosted-zone-changed-files.outputs.any_changed == 'true'
run: |
echo "hosted_zone_changed_files=${HOSTED_ZONE_CHANGED_FILES}" >> "$GITHUB_ENV"
echo "$hosted_zone_changed_files"
- name: Check change status
id: check-change-status
if: steps.hosted-zone-changed-files.outputs.any_changed == 'true'
run: |
source venv/bin/activate
python3 check_change_status.py
env:
CHANGE_STATUS_OUTPUT: ${{ fromJSON(env.CHANGE_STATUS_OUTPUT) }}
AWS_ACCESS_KEY_ID: ${{ secrets.OCTODNS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.OCTODNS_AWS_SECRET_ACCESS_KEY }}
PYTHONUNBUFFERED: 1
- name: Test output retrieval
run: |
echo $CHANGE_STATUS_OUTPUT
- name: Send notification to Slack
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 #v1.24.0
with:
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "📋 Test DNS Change Status Check"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "```${{ env.CHANGE_STATUS_OUTPUT }}```"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK