Skip to content

Cleanup untagged containers #142

Cleanup untagged containers

Cleanup untagged containers #142

name: Cleanup untagged containers
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
jobs:
organization_containers:
name: Get all containers in the organization
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.organization-containers.outputs.packages }}
steps:
- name: Organization containers
id: organization_containers
uses: tue-robotics/tue-env/ci/organization-packages@MatthijsBurgh-patch-1
with:
package-type: container
token: ${{ secrets.DEPENDABOT_TOKEN }}
delete_untagged_containers:
name: Delete untagged containers
runs-on: ubuntu-latest
needs: organization_containers
strategy:
fail-fast: false
matrix:
package_name: ${{ fromJson(needs.organization_containers.outputs.packages) }}
steps:
- uses: actions/delete-package-versions@v4
with:
package-name: ${{ matrix.package_name }}
package-type: container
delete-only-untagged-versions: true
min-versions-to-keep: 0