name: MUDA Weekly Waste Audit

on:
  schedule:
    - cron: "0 21 * * 0"  # Sunday at 21:00 UTC
  workflow_dispatch:

jobs:
  muda-audit:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"

      - name: Run MUDA audit
        env:
          GITEA_URL: "https://forge.alexanderwhitestone.com"
        run: |
          chmod +x bin/muda-audit.sh
          ./bin/muda-audit.sh

      - name: Upload audit report
        uses: actions/upload-artifact@v4
        with:
          name: muda-audit-report
          path: reports/muda-audit-*.json
