2024-11-30 06:42:12 +00:00
|
|
|
name: Daily AXFR Scan
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
# Run at midnight UTC daily
|
|
|
|
- cron: '0 0 * * *'
|
|
|
|
# Optional: Allow manual triggering
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
scan:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
# Full git history needed to track changes
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2024-11-30 06:55:36 +00:00
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install dnspython
|
|
|
|
|
2024-11-30 07:03:18 +00:00
|
|
|
- name: Create directories
|
2024-11-30 06:42:12 +00:00
|
|
|
run: |
|
2024-11-30 07:03:18 +00:00
|
|
|
mkdir -p axfrout/root
|
2024-11-30 06:55:36 +00:00
|
|
|
chmod +x ./extras/mdaxfr.py
|
2024-11-30 06:42:12 +00:00
|
|
|
|
2024-11-30 07:03:18 +00:00
|
|
|
- name: Run AXFR scan with TLDs
|
2024-11-30 06:42:12 +00:00
|
|
|
run: |
|
2024-11-30 07:03:18 +00:00
|
|
|
python ./extras/mdaxfr.py --tlds
|
2024-11-30 06:42:12 +00:00
|
|
|
|
|
|
|
- name: Configure Git
|
|
|
|
run: |
|
|
|
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
|
|
|
|
|
|
|
- name: Commit and push changes
|
|
|
|
run: |
|
2024-11-30 07:03:18 +00:00
|
|
|
# Stage both directories
|
2024-11-30 06:42:12 +00:00
|
|
|
git add axfrout/
|
2024-11-30 07:03:18 +00:00
|
|
|
git add root/
|
2024-11-30 06:42:12 +00:00
|
|
|
|
|
|
|
# Only commit if there are changes
|
|
|
|
if git diff --staged --quiet; then
|
|
|
|
echo "No changes to commit"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
git commit -m "Auto: Daily AXFR scan results $(date -u '+%Y-%m-%d')"
|
2024-11-30 07:03:18 +00:00
|
|
|
git push
|