name: 🤖Automation - ci-package-cleaner

on:

  workflow_dispatch: # manual option

  # schedule:
  #   - cron: '15 22 * * 1' # every Monday 10.15pm UTC (~11.15am Tuesday NZT)

jobs:

  package-cleaner:
    name: package-cleaner
    runs-on: ubuntu-latest
    timeout-minutes: 5
    permissions:
      packages: write
    steps:

      - uses: actions/delete-package-versions@v4
        with: 
          package-name: netalertx
          package-type: container
          min-versions-to-keep: 0
          delete-only-untagged-versions: true