Repository navigation
Cleanup GHCR Images #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Cleanup GHCR Images | |
| # | |
| # This workflow cleans up old images from GitHub Container Registry | |
| # to prevent unlimited storage growth. It runs weekly and removes: | |
| # 1. Old test-runner versions (keeps 5 most recent) | |
| # | |
| # Note: cleanup of dated vector nightly images requires a token with | |
| # delete:packages scope (GITHUB_TOKEN is insufficient for org-owned | |
| # container packages). This is tracked separately. | |
| name: Cleanup GHCR Images | |
| on: | |
| schedule: | |
| # Run weekly on Sundays at 2 AM UTC | |
| - cron: "0 2 * * 0" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read # Restrictive default | |
| jobs: | |
| cleanup-test-runner: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| packages: write # Required to delete package versions from GHCR | |
| steps: | |
| - name: Delete old test-runner images | |
| uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5.0.0 | |
| with: | |
| package-name: vector/test-runner | |
| package-type: container | |
| min-versions-to-keep: 5 |